Bash Uptime
Learn how to read system uptime and load averages with the uptime command to gauge how busy a Linux machine is.
What uptime Reports
The uptime command prints four things on one line: the current time, how long the system has been running since its last boot, how many users are logged in, and the load average over the last 1, 5, and 15 minutes. It is often the very first command run when checking whether a server is healthy.
Example
$ uptime
14:32:07 up 18 days, 4:12, 3 users, load average: 0.42, 0.51, 0.63The load average numbers represent the average number of processes that were either running on the CPU or waiting for their turn, sampled over each time window. A single number on its own means little, since it only makes sense once compared against how many CPU cores the machine actually has.
Example
$ nproc
4Interpreting Load Relative to Cores
With 4 cores, a load average of 4.0 means the CPUs are fully occupied with no queue. Below 4.0 means there is spare capacity, and above 4.0 means processes are waiting in line for CPU time. Reading all three windows together also shows a trend: a 1-minute value much higher than the 15-minute value means load just spiked, while the reverse means things are cooling down.
Example
$ uptime
09:15:44 up 3 days, 1:02, 1 user, load average: 7.85, 4.20, 2.10- load average: 0.42, 0.51, 0.63 covers the 1, 5, and 15 minute windows
- uptime -p prints a pretty format, such as up 2 weeks, 3 days, 4 hours
- uptime -s prints the exact boot timestamp instead
- w behaves like uptime but adds who is logged in and what they're running
- cat /proc/loadavg shows the raw numbers uptime reads from
Exercise: Bash System Info
What does the "uname -a" command display?