Mark Atwood (fallenpegasus) wrote,
Mark Atwood

Some basic advice for running MySQL on Amazon AWS EC2

I've been recently asked for advice on running MySQL on EC2.

  • Run only a one MySQL server process on the instance.

  • This bears repeating. Run only the MySQL server on the instance. Not your app server, or your dev environment, or your...

  • Use the large or xlarge size, not the small size.
  • Dedicate the additional partitions to be InnoDB tablespaces.
  • "Pre-heat" the tablespace partition with dd. That is, dd if=/dev/urandom of=/path/to/part bs=8K before using the partition.
  • This is one of the times where it's worth it to run tablespace on raw devices. Don't bother to put a filesystem down on those partitions.
  • Tune your database server. Get someone who knows MySQL tuning to do it for you.
  • Backup and Replicate with rigor. When an instance gets shut down, it Goes Away, including the filesystem.
  • Control access. Setup ec2 access rules so that only your known clients and relication peers can connect to the MySQL server port, and severely limit any other access. At most the SSH port.
  • Automate everything. Be able to build, setup, and start new MySQL server instances, and new application server instances, by simply running a script or pushing a button.

This advice is not complete, your milage may vary, etc etc
Tags: mysql

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment