Archive for the ‘ Performance ’ Category

Disk I/O stats from /proc/diskstats

Disk I/O stats from /proc/diskstats

cat /proc/diskstats | grep 'sda '
   8    0 sda 2461810 61427 148062742 6482992 660009 1544934 67900384 45642376 0 7162961 52128751

Field 1 — # of reads issued
Field 2 — # of reads merged, field 6 — # of writes merged
Field 3 — # of sectors read
Field 4 — # of milliseconds spent reading
Field 5 — # of writes completed
Field 7 — # of sectors written
Field 8 — # of milliseconds spent writing
Field 9 — # of I/Os currently in progress
Field 10 — # of milliseconds spent doing I/Os
Field 11 — weighted # of milliseconds spent doing I/Os

Linux command line – measure disk performance

It can be quite annoying to clone your virtual LVM xen images and you notice that the host machine takes about 3 hours to clone a tiny 15Gb image.


A very handy tool, which is normally installed on RadHat / CentOS / Fedora machines is ‘hdparm’.
It gives you very quickly a slight idea of the disk performance.

hdparm -t /dev/drive

Clone xen LVM with ‘virt-clone’:

virt-clone -o existing_not_running_vm -n new_vm -f /dev/VolGroup00/new_vm --prompt