问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
