3 Linux Performance Tools
From:     https://www.redhat.com/sysadmin/performance-troubleshooting-video


Intro Great Lin Resources Start At The Top Are You Free
Check Vmstat




3 fundamental tools to troubleshoot Linux performance problems

In this article and video, you'll learn how to collect information about your Linux system's performance. Posted: March 6, 2023 | %t min read | by Nathan Lager (Sudoer, Red Hat) A row of old tools for cutting and carving Photo by Philip Swinburn on Unsplash Performance is one of those things that many system administrators dread. Sometimes you don't even think about it when things are running well. Then, suddenly you get a call from an end user, or even worse, lots of end users, that the application you're responsible for "feels slow." Or maybe it's outright unavailable. Now you have to go into troubleshooting mode.
Great Linux resources Where do you start, though? In this article, I'll walk through some basics, but first, I'll take a step back. It's important to have some baseline information about your system before trying to identify problems. Maybe your system is doing something it shouldn't be, and that is contributing to the high load. Or perhaps it's doing exactly what it always has, and it's just under some additional load. Performance troubleshooting starts before a problem occurs by keeping good documentation and historical performance data. A recent episode of Into The Terminal examines performance troubleshooting. This article summarizes three utilities that provide great initial performance information and introduces the concepts covered by the video. If you'd rather, you can skip straight to the video. Start at the to
The first go-to performance troubleshooting tool is top. The top utility gives you a great, constantly updated process and performance dashboard. How much memory is in use? What's the load average? What processes are using the most resources? All of this is ready at a moment's notice in top.
top - 10:55:50 up 6 min, 1 user, load average: 0.03, 0.18, 0.10
Tasks: 188 total, 1 running, 187 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.6 us, 0.0 sy, 0.0 ni, 99.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3654.6 total, 1477.3 free, 700.3 used, 1752.4 buff/cache
MiB Swap: 3280.0 total, 3280.0 free, 0.0 used. 2954.3 avail Mem
PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND
3root0-20000I0.00.00:00.00rcu_gp
4root0-20000I0.00.00:00.00rcu_par_gp
5root0-20000I0.00.00:00.00netns
6root200000I0.00.00:00.01kworker/0:0-xfs-c+
7root0-20000I0.00.00:00.00kworker/0:0H-even+
8root200000I0.00.00:00.16kworker/u8:0-flus+
9root0-20000I0.00.00:00.00mm_percpu_wq
10root200000I0.00.00:00.36kworker/u8:1-even+
11root200000I0.00.00:00.00rcu_tasks_kthre
12root200000I0.00.00:00.00rcu_tasks_rude_
13root200000I0.00.00:00.00rcu_tasks_trace
14root200000S0.00.00:00.03ksoftirqd/0
15root200000I0.00.00:00.41rcu_preempt
16rootrt0000S0.00.00:00.00migration/0
17root200000I0.00.00:00.00kworker/0:1-xfs-c+
18root200000S0.00.00:00.00cpuhp/0
19root200000S0.00.00:00.00cpuhp/1
Additionally, you can filter top, search for processes, or even view the utilization of each core in your system. So, your first stop should be top! [ Learn how to manage your Linux environment for success. ] Are you free?
The free tool displays the system's current memory consumption, and it's a great second stop in your journey to discover what's eating at your system.
totalusedfreesharedbuff/cacheavailable
Mem:37423527174081512544531217945203024944
Swap:335871603358716
Remember that the Linux kernel will take available memory and allocate it to disk buffers and cache. Linux will release those resources when the system needs them, so if free suggests that you have no available memory, be sure to check that buffers/cache column before you conclude that you're out of memory. Check vmstat
Using vmstat is another great way to look at your memory consumption.
procs-----------memory-------------swap-------io-----system--------cpu-----
rbswpdfreebuffcachesisobiboincsussyidwast
00015118169684178494800233676256262329500
It breaks down the buffers and cache, and you'll also get information about your swap utilization. Swapping is generally a sign that your system is exhausting its higher-performing memory, and it must resort to swapping to disk. This process can have a devastating effect on some applications. [ Keep your most commonly used commands handy with the Linux commands cheat sheet. ]