I'm running a Wordpress installation on an Amazon Ec2 micro instance(linux ami). Using the default configuration Apache kept using up all the memory and shutting down mysql rendering wordpress non-functional.

I adjusted my apache configuration based on information from Making WordPress Stable on EC2-Micro and changed the mysql configuration to the sample configuration for small servers.Those adjustments seem to have dealt with the memory issue.

However, I noticed that with mysqld service turned off cpu usage hovers around 0 -5% with 10% being a peak but as soon as I start mysql cpu time stays between 40 -60%. Is this normal? and what can I do to remedy it if it is not. Its just a test server so there's virtually no traffic to the site.I also checked with mysqladmin processlist and stat commands,there was no indication of any 'evil' queries.

  • 1
    What is your %st in top? Is that relevant? Jul 27, 2012 at 14:55
  • @DavidCsonka i checked the %st and it also hovers around 50% frequently,but if i understand correctly this is mainly reinforcing the fact that mysqld is asking for a lot of cputime and hence my enitre vm is at many points not getting all the cputime it requests
    – jgatcher
    Jul 30, 2012 at 14:02
  • Exactly as you said @JosephAmegatcher. WordPress makes a lot of joins in each run, so it hits the db quite often with CPU intensive tasks; and the micro instance just doesn't like it and your instance gets CPU constrained. Try switching your instance to a medium one and see the difference immediately. Jul 30, 2012 at 14:50
  • @JavierConstanzo Can't switch to a medium instance yet because i'm relying on amazon's free tier.. but does that mean that this is the expected behavior of mysql when Wordpress is run on an ec2 micro instance?Especially since there isn't even yet traffic to the blog..
    – jgatcher
    Aug 1, 2012 at 12:19
  • @JosephAmegatcher in my experience, I would only host plain html in a micro instance running a web server. YMMV though. Aug 7, 2012 at 4:20

1 Answer 1


The keyword here is micro instance. Micros are a great way to handle low-demand and intermittent loads, as long as you are comfortable with the latency. What is happening on startup is that you are consuming your cpu "spike" buffer and then the VM is getting clamped, resulting in high steal-time. This is how micros are designed to operate, not a problem with WP or MySQL or even with your AWS setup.

This page in the AWS docs talks about micros and how they behave under load. It sounds like your workload (test server, no users) is a good fit for using a micro, just be aware of the cpu clamping that will occur when you restart a service.

I've used micro instances for doing work on Plone, which consumes a huge amount of cpu on startup. At first I was quite surprised, but it was fine once I got used to it. EDIT- was suggesting moving up to a small but saw OP's comment about using free-tier. Free tier usage is what it is, a nice introduction to AWS but not a production setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.