大网数据广告活动
网站运营与故障问答

amazon EC2 running both a website and database

· 52CE 我爱测

I need to move a webserver from Rackspace to AWS and i was wondering if i need to add a separate service/server for mysql database, or can i host the website and the mysql database on the same EC2 instance. ( tier = small ) On Ra…

问题原文

原帖链接 · Rainer Plumer · CC BY-SA 3.0

I need to move a webserver from Rackspace to AWS and i was wondering if i need to add a separate service/server for mysql database, or can i host the website and the mysql database on the same EC2 instance. ( tier = small )

On Rackspace DB was hosted on another server. Both webserver and DB server consumed : Overwall DB size = 100MB Overall Disc usage : 30GB Avarage Memory usage: 1GB.

Can a single ec2 small instance do the work of both webserver and db ?

已采纳解答

原帖链接 · Michael - sqlbot · CC BY-SA 3.0

I don't know whether this question is on-topic for Webmasters, but running the database and web server on the same machine leads to issues I've addressed at Database Administrators SE and Server Fault revealing repeatedly that the two tend to peak together in their demands for memory and other resources, leading to the appearance of "crashes" which are actually cases of server resource exhaustion under load rather than actual software defects.

Running them together on the same machine is not a recipe for stability, even if the machine is theoretically capable.

Using one machine instead of two is a false economy, particularly since, with EC2, machine pricing within each instance family is almost directly proportional to capacity.

Two t2.micro is exactly the same price of one t2.small, which has twice the CPU allowance and twice the memory... flip that around and you see that the micro is half of a small for half of the cost. Use two machines.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2015-10-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。