问题
I've got a new website that is Joomla driven and contains many custom apps that depend on the Mysql database. This is all hosted on Amazon EC2 with the root device being EBS.
My concern is with my Mysql setup. I've installed mysql-server with pretty much default settings (other than the security cleanup).
My question is if I should be setting up Mysql to run on a separate EBS volume: http://aws.amazon.com/articles/1663 or should I even be looking at Amazon RDS: http://aws.amazon.com/rds/mysql/?
These both seem overkill for my startup right now with 0 users. I obviously want to make sure I'm proactive in case this does grow but I have no idea if it will be a major pain to add these later?
回答1:
I would definitely say you should setup MySQL to run on another EBS volume for many reasons. Here are a few:
Easier backups. You can snapshot the entire EBS volume rather than doing a MySQL dump and pushing it to S3. When you have a snapshot of the volume, you can restore your database much quicker than with a MySQL dump.
Disk contention. You will see some disk contention when you run everything on the same disk. Especially if you are trying to do MySQL replication. I have one volume for MySQL logs, one for Data, and one for everything else.
EBS volumes are relatively cheap.
You can move the entire volume to another instance if you need to.
Overall it is a much better choice. I could give you more reasons if you need them.
I think you could get by on EBS volumes for a while and then decide to shard, rewrite application for NOSql, move to Amazon RDS, etc. But my opinion is to use up MySQL until there is nothing left.
回答2:
I wrote that MySQL on EBS article before RDS was available.
I would recommend you start with RDS. It's simple to set up, takes care of many worries for you, and is fun.
Only switch to managing your own MySQL if you hit some limitation of RDS down the line (not tremendously likely); and when you do, follow best practices in my article and use a separate EBS volume.
回答3:
If you do not use RDS, you should consider striping multiple EBS volumes into a software RAID configuration.
If you do not, you may well find that the EBS IO performance is too poor for a modestly busy MySQL instance.
For details on how to do that, check out
http://alestic.com/2009/06/ec2-ebs-raid
来源:https://stackoverflow.com/questions/9131556/setup-website-on-amazon-ec2-with-mysql