Difference between revisions of "Disk usage related information"

From Notes_Wiki
m
m
 
Line 28: Line 28:
=atop=
=atop=


Atop is a more comprehensive monitoring tool.  It looks at CPU, RAM, hdd, etc. all parameters while monitoring.  This can be useful if combination of various parameters need to be monitored using same tool.  To start atop use:
Information on atop is available at [[Rocky 9.x atop]]
<pre>
atop
</pre>


==Using atop for system activity recording similar to sar==
Atop can also be used to record activity at regular intervals.  Compared to [[CentOS 8.x System Activity Reporter (sar)|sar]] this will give a very detailed record of all processes including their memory, disk, etc. utilization.  To run atop in background we can use:
<pre>
nohup atop -w /opt/atop.raw 300
</pre>
The above command will record atop values in the file every 300 seconds. 
Once the file is available we can view it via:
<pre>
atop -r /opt/atop.raw
</pre>
To go to next interval in the file use 't'.  To go to previous interval in raw file use 'T'.
==Atop keyboard shortcuts==
; g : Show general output (Default)
; m : Show memory related output
; d : Show disk related output
; n : Show network related output (Did not work in Rocky due to missing netatop kernel module)
; s : Show scheduling characteristics.
; v : Show various process characteristics.
; c : Show the command line of the process.
; e : Show GPU utilization.
; y : Show the individual threads within a process (toggle).
; Y : Sort the threads per process when combined with option 'y' (toggle).
; u : Show the process activity accumulated per user.
; p : Show the process activity accumulated per program (i.e. process name).
; j : Show the process activity accumulated per Docker container.
; C : Sort the current list in the order of cpu consumption (default).  The one-but-last column changes to ``CPU''.
; E : Sort the current list in the order of GPU utilization
; M : Sort  the  current list in the order of resident memory consumption. 
; D : Sort the current list in the order of disk accesses issued. 
; N : Sort the current list in the order of network bandwidth (received and transmitted). 
; A : Sort the current list automatically in the order of the most busy system resource during this interval.
; z : Pause periodic refresh as per interval
; i : Modify  the  interval timer (default: 10 seconds). If an interval timer of 0 is entered, the interval timer is switched off. In that case a new sample can only be triggered manually by pressing the key 't'.
; b : When  viewing  the  contents  of  a  raw  file, this key can be used to branch to a certain timestamp within the file either forward or backward.
; U : Specify a search string for specific user names as a regular expression. 
; I : Specify a list with one or more PIDs to be selected.
; P : Specify a search string for specific process names as a regular expression.
; / : Specify  a  specific command line search string as a regular expression. \
; J : Specify a Docker container id of 12 (hexadecimal) characters.
; Q : Specify  a  comma-separated  list  of process/thread state characters.  From now on, only processes/threads will be shown that are in those specific states.  Accepted states are: R (running), S (sleeping), D (disk sleep), I (idle), T (stopped), t (tracing stop), X (dead), Z (zombie) and P (parked).
; S : Specify search strings for specific logical volume names, specific disk names and specific network interface names.
Go through '<tt>man atop</tt>' for considerable more detail than listed above.


[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Information tools]] > [[Disk usage related information]]
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Information tools]] > [[Disk usage related information]]

Latest revision as of 07:22, 15 June 2023

Home > CentOS > CentOS 6.x > Information tools > Disk usage related information

If the performance of a system is poor, then the most common reasons for poor performance are high usage of CPU, memory, network or disk. CPU usage can be monitored using top or htop, memory usage can be seen using free -m or top, network usage can be seen using iptraf, tcptrack, etc. Similalry for disk usage one can use:

  1. iostat
  2. iotop
  3. atop


iostat

One can use following command:

iostat 5

to see disk usage in last five seconds to see if disk usage is very high. The first set of values printed are cumulative till the command was run, so they should be ignored. Second set of values onwards can be used for actual diagnosis.


iotop

Sometimes machine may be too slow and using top may indicate very high value of %wa indicating slowness due to disk I/O. If this continues for long even load average would increase to indicate slow performance. To figure out which processes are using more disk we can install 'iotop' tool which lists processes in order of their disk usage.

To see top like listing of processes but in terms of their disk usage and not CPU, one can use:

iotop


atop

Information on atop is available at Rocky 9.x atop


Home > CentOS > CentOS 6.x > Information tools > Disk usage related information