How can I record system resource utilization over time on Ubuntu?

Question

I want to record system resource utilization – CPU, RAM, SWAP, perhaps HD access – on my Ubuntu system over time so that I can compare two configurations (in my case, I am comparing using gnome vs. using xfce)

What would be a good way to record the system resource utilization and then graph the results on my Ubuntu system?

Asked by pcapademic

Answer

You can use dstat with gnuplot for very detailed graphs:

alt text

There is also the option of vmstat with vmplot:

Sample vmstat output:

[john@awesome]$vmstat -n 1
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0      0 14234008 438580 1195172    0    0     6    35    1    1  2  5 93  0  0
 1  0      0 14233824 438592 1195176    0    0     4   100 1035 2170  0 50 49  0  0
 1  0      0 14233824 438592 1195176    0    0     0    32 1030 2139  3 48 50  0  0

Sample vmplot graph:

alt text

Answered by John T