Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

At certain seemingly random parts of the day, my CPU usage will spike up from ~10% on 1 m1.large to 70% on 4 large servers. This all happens within 20 minutes and stays this way for a few hours and often while I'm asleep.

Assuming this is legitimate application traffic, how can I track exactly which http requests or cluster of HTTP requests are responsible for the CPU usage so I know what to optimize?

I've had a look at the apache http log but it doesn't help much because the number of requests is basically the same as it usually is.

share|improve this question
    
What makes you think this is being caused by Apache requests and not, say, the compressing of the days logs? You may want to look at your cron jobs and other utilities that may be scheduling things at night. –  Andrew M. May 14 '12 at 20:25
    
Thanks for the response Andrew, this is definitely our application at work (a specific customer using the service). The high CPU utilization goes on for about 5-6 hours and we're running a barebones elastic beanstalk instance and don't have any cron jobs other than the ones Beanstalk uses. –  Jack May 14 '12 at 20:33
    
If you know the customer, then you should be able to replicate their actions--can you reproduce the issue you're seeing? –  Andrew M. May 15 '12 at 5:22

1 Answer 1

You can use Apache mod_status with extended status option to check running requests and time taken to process it. https://httpd.apache.org/docs/2.0/mod/mod_status.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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