14 Eylül 2022 Çarşamba

pidstat komutu

Giriş
Açıklaması şöyle
A common (and pretty good) answer is to use top. But there is one issue with top it’s difficult to copy the output to a scratch pad where you keep details about your debugging or if you’d want to send the output to someone else.

To get an output which is easy to read and copy friendly, run pidstat | head -n 20 or e.g. pidstat -u 5 60 to get updates every 5 seconds for the next 6 seconds.
Örnek
Şöyle yaparız
$ pidstat | head -n 20
Linux 5.13.0-40-generic (tsunami)       05/03/2022      _x86_64_        
(8 CPU)
UID       PID    %usr %system  %wait    %CPU   CPU  Command
  0         1    0.00    0.01   0.00    0.01     7  systemd
  0         2    0.00    0.00   0.00    0.00     1  kthreadd
  0        12    0.00    0.00   0.00    0.00     0  ksoftirqd/0
  0        13    0.00    0.06   0.02    0.06     7  rcu_sched
  0        14    0.00    0.00   0.00    0.00     0  migration/0
  0        19    0.00    0.00   0.00    0.00     1  migration/1
  0        20    0.00    0.00   0.00    0.00     1  ksoftirqd/1
Açıklaması şöyle
%usr to find high user space time allocation. This would indicate an application in need of scaling for example.

%system to find high system / kernel space time allocation. Remember that this could be due to driver issues or other similar kernel level problems.

%wait would yet again indicate I/O latencies.





Hiç yorum yok:

Yorum Gönder