1

目前我们有一个运行 apache 和 mysql 的 EC2。我想知道将 mysql 移动到另一个 EC2 实例是否会提高或降低站点的性能。我更担心两个实例之间的网络速度问题。

4

2 回答 2

6

EC2 instances in the same availability zone are connected via a 10,000 Mbps network - that's faster than a good solid state drive on a SATA-3 interface (6Gb/s)

You won't see any performance drop by moving a database to another server, in fact you'll probably see a performance increase because of having separate memory and cpu cores for the two servers.

If your worry is network latency then forget about it - not a problem on AWS in the same availability zone.

Another consideration is that you're probably storing your website & db file on an EBS mounted volume. That EBS block is stored off-instance so you're actually storing a storage array on the same super-fast 10Gbps network.

So what I'm saying is... with EBS your website and database are already talking across the network to get their data, putting them on seperate instances won't really change anything in that respect - besides giving more resources to both servers. More resources means more data stored locally in memory and more performance.

于 2012-05-02T11:04:03.367 回答
1

答案很大程度上取决于 apache 和 MySQL 使用的资源。如果对您的网站的需求很低,他们可以愉快地共同生活,并且每个人都配置了足够的内存,他们不会掏出虚拟内存。在这种情况下,最好将它们放在一起。

随着流量的增长或您的应用程序的增长,您将从拆分它们中受益,因为它们都可以在专用内存中运行。如果实例位于同一区域,那么您应该会看到它们之间的快速性能。我什至用美国的数据库在欧洲运行了一个 Web 应用程序,性能并没有明显差!不过我不建议这样做!

因为 AWS 既简单又便宜,最好的办法是设置它并对其进行基准测试!

于 2012-05-02T10:48:13.130 回答