SEARCH

How-To Geek

Get CPU / System Load Average on Ubuntu Linux

Ubuntu linux has a rich set of commands for getting system info. One of the useful pieces of information that a system administrator might need is to know what the overall system load on a server is.

There are a couple of ways to get this information, which may or may not be enabled on your system. It’s useful to know more than one way to get the uptime information in case the commands are disabled on your shared hosting server.

uptime

The uptime command gives information on system load averages for the past 1, 5, and 15 minutes:

Example:

[root@ubuntu geek]# uptime
05:59:07 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39

w

The w command shows who is logged on and what they are doing, including system load averages for the past 1, 5, and 15 minutes.

[root@ubuntu geek]# uptime
05:59:56 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
geek pts/0 192.168.1.115 6:31pm 0.00s 0.62s 0.03s /usr/sbin/sshd

/proc/loadavg

The /proc/loadavg file contains information on the system load. Most likely the uptime/w commands utilize this information. The first 3 values contain system load averages for the past 1, 5, and 15 minutes.

[root@ubuntu geek]# cat /proc/loadavg
0.00 0.00 0.39 1/49 15352

There are probably some more commands, but these are the ones off the top of my head that I know of.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 11/28/06

Comments (5)

  1. netking

    there’s also the top command ;-)

  2. oliver

    Hi,
    do you know how to get the load on each processor on a server. Not the global load but the specific one ?
    thx for the answer

  3. Steve

    I know top can give you the usage for each core. I’m not sure if it does it out of the box, or if there’s any special configuration required.

    1787 processes: 1782 sleeping, 2 running, 3 zombie, 0 stopped
    CPU0 states: 7.0% user 5.1% system 0.0% nice 0.0% iowait 87.0% idle
    CPU1 states: 18.1% user 1.0% system 0.0% nice 0.0% iowait 80.0% idle
    CPU2 states: 33.1% user 0.1% system 0.0% nice 0.0% iowait 65.0% idle
    CPU3 states: 40.0% user 2.0% system 0.0% nice 0.0% iowait 57.0% idle
    CPU4 states: 7.1% user 0.1% system 0.0% nice 3.0% iowait 88.0% idle
    CPU5 states: 7.1% user 29.0% system 0.0% nice 0.0% iowait 62.1% idle
    CPU6 states: 25.1% user 1.0% system 0.0% nice 0.0% iowait 72.1% idle
    CPU7 states: 16.0% user 0.1% system 0.0% nice 0.0% iowait 83.0% idle

    For example this would be shown right at the top for a multi-core system.

  4. Bob

    You can use the grep command to monitor the CPU load average:

    top -b | grep -2 “load average”

  5. brainextender

    I’m a little curious how to get the load of a single core from the /proc file system?

Enter Your Email Here to Get Access for Free:

Go check your email!