Archive for December, 2009

howto: check disk utilization

Monday, December 7th, 2009

Disk IO and usage can be checked very easily via ssh, currently the bandwidth usage is 82mbit. IO wait can be checked using the ‘vmstat 1‘ command and looking on the pre-last column called ‘wa’:

procs ———–memory———- —swap– —–io—- –system– —–cpu——

 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st

 1  1    476 8209760  17060 6923844    0    0   550    22    1    0 10  6 78  7  0

 2  2    476 8176176  17152 6934184    0    0  5552     0 7435 2960 26  5 61  8  0

 2  0    476 8198232  17160 6938080    0    0  2788     0 6260 2412 14  2 83  1  0

 1  1    476 8189900  17184 6947160    0    0  3500     0 7751 2857 22  3 72  3  0

 2  0    476 8147572  17192 6963164    0    0  3188   264 10083 3223 24  4 69  3  0

 1  0    476 8171132  17208 6966848    0    0  2924     0 5948 2234 18  2 78  2  0

 1  1    476 8166708  17220 6972064    0    0  1960     0 6731 2774 15  3 80  2  0

 2  1    476 8133964  17236 6982200    0    0  3164     0 8228 3292 18  5 73  4  0

 1  0    476 8128256  17252 6986012    0    0  3716     0 5876 2995 21 12 65  3  0

 1  2    476 8102740  17336 6990420    0    0  2420   636 6364 3884 22 12 59  8  0

 

As you can see, its varies from 0-8 which is normal, when IO more than 20-30 for long time means IO is in moderate usage, when its over 50 it is high.

 

Another command to check disk utilization is ‘iostat –dx 5‘, it calculates 5 seconds disk resources utilization:

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util

sda              18.60     9.80 114.00  8.00  8777.60   142.40    73.11     1.65   13.78   5.44  66.32

sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

sda2             18.60     9.80 114.00  8.00  8777.60   142.40    73.11     1.65   13.78   5.44  66.32

dm-0              0.00     0.00 131.80 17.80  8696.00   142.40    59.08     1.95   13.27   4.43  66.34

dm-1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

 

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util

sda              27.40     5.00 110.20  7.20  8624.00    97.60    74.29     2.06   17.53   5.88  69.02

sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

sda2             27.40     5.00 110.20  7.20  8624.00    97.60    74.29     2.06   17.53   5.88  69.02

dm-0              0.00     0.00 138.40 12.20  8648.00    97.60    58.07     2.96   19.65   4.58  69.00

dm-1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

 

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util

sda              21.16     5.79 122.36  6.39  9203.99    97.41    72.25     1.88   14.63   5.23  67.33

sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

sda2             21.16     5.79 122.36  6.39  9203.99    97.41    72.25     1.88   14.63   5.23  67.33

dm-0              0.00     0.00 142.71 12.18  9180.04    97.41    59.90     2.36   15.25   4.35  67.31

dm-1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

the last column says about 57-65% utilization of the disks, which is normal at 100mbit (the current bandwidth is 100mbit now).

Another test can be done at rush hours to check the utilization, usually SATA disks in RAID 1 configuration can handle 150-250mbit (depends on number of concurrent connections).