As a Linux system admin you would at some point need a system load average of your server. There a various tools to help with this task and the ones most obvious are top and uptime commands.
$ uptime 
09:43:17 up 247 days,  8:15,  1 user,  load average: 0.21, 0.35, 0.37
Uptime displays information relating to the number of days your system is up and running as well as an average system load. The same data as well as mo information regarding memory usage and processes can by obtained with top command.

The only problem here is if you are looking for system's average load for the entire period of time since your server booted. What top and uptime commands are reporting are only system load averages for the past 1, 5, and 15 minutes.

Therefore, what we need is a tool which reports not only last few minutes but the entire uptime period. This tool is vmstat. By default and with no arguments vmstat report load averages since the last server reboot. Example:
$ vmstat 
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 194760 176896 855416    0    0    12    78    2    0  7  2 83  1
vmstat also accepts arguments.
$ vmstat 10 3
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 187528 177472 855836    0    0    12    78    2    0  7  2 83  1
 0  0      0 203996 177532 855848    0    0     0   107  126  208  4  2 89  1
 0  0      0 194108 177540 855856    0    0     0     3  102  166  2  1 96  0
The above vmstat command produced 3 reports with 10 seconds delay. Please note that the first line always contains values for entire server uptime. Apart of the system load averages since the last server reboot report, this tools can also be used to monitor performance for a prolonged period of time. For example the below command will produce 24 hours system load in 10 seconds intervals:
$ vmstat 8640 10

Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top