I'm trying to troubleshoot some CPU spikes that occur every so often on a Linux server. I can use sar to see the resource utilization in the past, and pidstat to see what processes are using what resources, but pidstat doesn't go into the past.

So what I'm looking for is a combination of both - Something that I can use to see what processes were taking up what resources. I haven't been able to find anything, and I know I can write a simple bash script to save the output of pidstat to a file, but if there's already a solution for this (which I would be surprised if there isn't), then I'd rather not re-invent the wheel.


  • It might be something of a case of deer hunting with a howitzer, but you can do what you're looking for with Splunk ingesting server logs and the like; you can then very easily pull out and even rapidly chart the data over time. – DopeGhoti Mar 28 '17 at 16:37

I believe atop does what your are looking for. It logs process resource utilization at intervals of your choice, and you can go back in time to see what happened at a specific time (atop -r logfile -b time then use t and T).

  • I was just comming back to answer my own question with atop, haha. Thank you! I was hoping to be able to test it on my macbook, but it doesnt look like theres an OSX version of atop :-\ – Justin Mar 28 '17 at 17:07

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.