Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am just reviewing the disk IO of a XEN VM server. I stumbled across a DomU that has constant write traffic.

To narrow that traffic further down I logged in to the DomU (CentOS 5, 64 Bit) and started iostat 5. It shows sda1 active with 130-190 Blocks written per second.

Disk-layout:

sda: Whole disk (corresponds to DRBD-device in the Dom0, consist of one LV in the Dom0)
sda1: /
sda2: /var
sda3: LVM-PV for application data, contains one LV mounted as subdirectory on /var

I tried to find open file handles on /dev/sda1 by issuing lsof /dev/sda1. The output of that command is empty. Whereas the output for lsof /dev/sda2 shows lots of files, pipes, ... (as is to be expected).

How can I track down what is causing this IO?

share|improve this question
    
If you're using virtualization, you're shooting at your own feet. You can't really expect to be able to track down problems easily, and your best move is to hope everything will be ok. Ask directly on their ML: lists.xen.org. If there's a way to track down this IO, I suppose it'll be specific to Xen. Your approach seems correct, and I'm looking forward for real answers. –  Aki Feb 7 '12 at 14:04
add comment

2 Answers

New kernels can do per-process I/O accounting, which you can see with iotop (yum install iotop). Also check out this link.

share|improve this answer
    
This seems to be a very nice tool. What repo do I have to activate to get it for el5? –  Nils Feb 7 '12 at 20:48
    
It's in the epel repository - download.fedoraproject.org/pub/epel –  Alien Life Form Feb 8 '12 at 9:11
add comment

As well as iotop, if you've got a new enough version of sysstat (not default with CentOS 5, unfortunately), you can use pidstat -d 5 to track per-process disk I/O statistics with a 5 second sample (for example).

(I should add: you'll need to do that inside the guest to see the process)

share|improve this answer
    
ok. I downloaded and compiled the latest stable 8.0 version. That is the first version, where pidstat appeared. Can I use some additional option to limit output to IO on /dev/sda1? –  Nils Feb 8 '12 at 15:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.