How to monitor top consumers of CPU in the past

I was having high consumptions of cpu. How could I know what was being executed at that time of high cpu consumption?

2 Replies

There really isn't a way to find out after the fact. If the issue happened at about 0:00 UTC on July 1, 2012, it's possible you hit a bug caused by the leap second being added to UTC to account for the slowing rotation of the Earth.

  • ~~[" target="_blank">]( … shes-today">](


Edit: If you did in fact hit this bug, rebooting should clear you right up.

If you don't mind a bit of scripting, you can cron something every minute or so using something like

top -bn1

within the script and then parse through the resulting text, writing to a file when the script finds something interesting to you. I prefer Python, so I might use

os.popen('top -bn1')

and parse the stdout result of os.popen() as needed.



Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct