Tech Junkie Blog - Real World Tutorials, Happy Coding!: Linux Performance: uptime, tload Command

Monday, April 11, 2022

Linux Performance: uptime, tload Command

 In this post we are going to look at another performance related command, which is the uptime command.

First let's look at the uptime command, as the name implies the uptime command shows you what the uptime is for the system:

[root@cent7 jhuynh]# uptime
 12:41:20 up  1:29,  2 users,  load average: 0.05, 0.04, 0.06

The command shows you the uptime for the system, the number of users who are using the system, and the system load average (Number of CPU used) in intervals of 5 minutes.

If you type w, you can see which users are using the system

[root@cent7 jhuynh]# w
 12:41:29 up  1:29,  2 users,  load average: 0.04, 0.04, 0.06
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
jhuynh   :0       :0               11:15   ?xdm?   3:02   0.49s /usr/libexec/gnome-session-binary --session gnome-classic
jhuynh   pts/0    :0               11:21    1.00s  0.42s 11.27s /usr/libexec/gnome-terminal-server

The load average is the most important stat in the uptime command however, it is currently static, and to get updates you need to run the uptime every 5 minutes.  There's a better way to monitor your Linux system.  But you have to call now, and for a limited time only for just $19.99 you can have the answer.  Since I am such a nice guy I am going to give you the answer for free.

What you can do is type the command tload and it will monitor the load average time in real-time. Before we run the tload command a good command to run is the lscpu command to see how many CPU you have.  For instance you have just one CPU and your load average is 1+ then you have got a problem.

[root@cent7 jhuynh]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel

Now let's run the tload command



There are two parts to the tload utility, at the top you will see the average load time in real time instead of the 1, 5, 15 minute interval like before.  But it will be dynamic and updates automatically based on the load.

On the bottom you will see a graphical representation of the load average, it's probably not going to win any awards for best graphics 


 







Everything looks fine right now, but if you open another terminal and run the dnf update -y command you will see the load changing accordingly. Or some tasks that would put stress on the system.

2 comments:

  1. Not just clothes by baby depot can help low income families with free baby clothes, cribs, books, and so on. The agency has been serving people for over a decade now and provides almost all the essential equipment for baby care.

    ReplyDelete
  2. Good and excellent article. Thanks https://www.vindhyaprocess.com

    ReplyDelete

Search This Blog