Amazon EC2 – Micro Instance 100% CPU Usage

amazon ec2central-processing-unit

My Amazon EC2 micro instance has 100% CPU usage very often.
I only have a wordpress installation on it. I'm still in production mode, so no users but I get 100% CPU usage.

Does someone know how to reduce it?
I get Amazon Email notifications every hour because of that that lasts over a period of over 300 seconds.

I already moved my database to RDS but didn't solve that problem. It just made it a bit better. Before moving to RDS with my database my Website always totally crashed when loading just one webpage.

My mysqld.log gives a errno 12 error that's why I also did innodb_buffer_pool_size=256M in my.cnf but didn't bring anything.

Would be thankful for every tip.

Best Answer

Keep in mind, the m2.micro instances are just that--they're small. Any real amount of load will max them out.

As @zvik pointed out in his comments, you should find out what processes are consuming the most memory and/or CPU cycles. He recommended running top, which is a command found on Linux distributions. By pressing Shift-P, it will sort them based on CPU usage. You will need to use this information to figure out where the bottleneck is. For example, if this is running Apache, the default config for Apache may be to launch more processes than the server is capable of.

Try running top and seeing which commands are consuming the most resources.