I have an ec2 c3.medium instance running. It has recently started maxing out the cpu making the server unresponsive. Rebooting the instance doesn't really help for long, although it does make apache serve sites again for an hour or so.
When I look at top I can see various apache processes running, this fluctuates between about 10 and 1, and the CPU% usage of these fluctuate up to about 30%.
When it is maxing out it is these apache processes that are the problem/
How can I find out what is driving these processes?
snapshot of top summary here
top - 16:06:32 up 33 min, 2 users, load average: 1.80, 1.67, 2.13
Tasks: 87 total, 2 running, 85 sleeping, 0 stopped, 0 zombie
Cpu(s): 55.4%us, 2.6%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 42.0%st
Mem: 3842540k total, 1698436k used, 2144104k free, 87556k buffers
Swap: 1048572k total, 0k used, 1048572k free, 501328k cached
2088 apache 20 0 707m 75m 31m S 17.9 2.0 0:53.59 /usr/sbin/httpd
2188 apache 20 0 698m 70m 27m S 17.9 1.9 0:59.35 /usr/sbin/httpd
1613 mysql 20 0 885m 200m 6860 S 10.6 5.4 3:41.55 /usr/libexec/mysqld
2197 apache 20 0 698m 86m 44m S 5.6 2.3 0:53.89 /usr/sbin/httpd
1864 apache 20 0 698m 78m 35m S 1.7 2.1 0:55.13 /usr/sbin/httpd
2097 apache 20 0 699m 87m 43m S 1.7 2.3 0:54.70 /usr/sbin/httpd
Not ever had this kind of issue so beyond looking at top not sure how to pin down where the issue is coming from.
thanks.
UPDATE: Didn't hear back from my question in the comments but interestingly the problem just resolved itself after happening for about 2 weeks which suggests to me that AWS was stealing too much CPU rather than it being an issue with our setup. Anyone any comments on this conclusion?