Databases Reference
In-Depth Information
• Memory size is limited. The largest EC2 instances currently offer 68.4 GB of mem-
ory. In contrast, commodity servers are available with 512 GB to 1 TB of memory.
• I/O performance is limited in throughput, latency, and consistency. There are two
options for storage in the AWS cloud.
The first is using EBS volumes, which are like a cloud SAN. The best practice in
the AWS cloud is to build servers on RAID 10 volumes over EBS. However, EBS
is a shared resource, as is the network connection between the EC2 server and the
EBS server. Latency can be high and unpredictable, even under moderate through-
put demands. We've measured I/O latency to EBS devices well into the tenths of
seconds. In comparison, directly attached commodity hard drives respond in
single-digit milliseconds, and flash devices are orders of magnitude faster even than
hard drives. On the other hand, EBS volumes have a lot of nice features, such as
integration with other AWS services, fast snapshots, and so on.
The second storage option is the instance's local storage. Each EC2 server has some
amount of local storage, which is actually attached to the underlying server. It can
offer more consistent performance than EBS, 7 but it does not persist when the
instance is stopped. The ephemeral nature of the local storage makes it unsuitable
for most database server use cases.
• Network performance is usually decent, although it is a shared resource and can
be variable. Although you can get faster and more consistent network performance
in commodity hardware, the CPU, RAM, and I/O tend to be the first bottlenecks,
and we haven't had problems with network performance in the AWS cloud.
As you can see, three of the four fundamental resources are limited in the AWS cloud,
in some cases significantly so. In general, the underlying resources aren't as powerful
as what's available in commodity hardware. We'll discuss the precise consequences of
this in the next section.
MySQL Performance in Cloud Hosting
In general, MySQL performance on cloud hosting platforms such as AWS isn't as good
as you can get elsewhere, due to weaker CPU, memory, and I/O performance. This
varies from cloud platform to cloud platform, but it is still generally true. 8 However,
cloud hosting might still be a high-enough performance platform for your needs, and
it's better for some needs than for others.
It shouldn't surprise you that with weaker resources to run the database, you can't
make MySQL run as fast when you host it in the cloud. What might surprise you is
7. Local storage is not actually allocated to the instance until it is written, causing a first-write penalty for
each block that is written. The trick to avoiding this penalty is to use dd to write the device full of data.
8. If you believe http://www.xkcd.com/908/ , then obviously all clouds have the same weaknesses. We're just
sayin'.
 
Search WWH ::




Custom Search