Check history of cpu/memory usage in ubuntu

cpu-usagememory usage

Is there a way for me to review cpu or memory usage on my ubuntu linux server? I've noticed my server (lamp set up) being slow at times, but by the time I log in as root and run a PS command, everything may have returned to normal.

It would be great to review a log of what resources different parts of the server consumed.

Best Answer

The sysstat collection of tools contains sar which is able to save system activity information: http://pagesperso-orange.fr/sebastien.godard/documentation.html