Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a virtual machine with a php based application (in apache) on it, when looking at disk activity there is a constant 170kbps write when apache is running.

When we apply load then the performance of the server is cpu bound but this seems to be directly related to disk write IO jumps of 20-30x. The CPU usage graph mirrors the write disk access graph.

Any ideas?

share|improve this question
up vote 2 down vote accepted

Two recommendations:

iotop is a handy program that shows you real-time I/O usage in a format like the top command. This should help you identify the script/binary thats doing all the I/O. I think this may already be installed on newer kernels, but yum may provide it on RHEL if you don't see it.

lsof is also helpful with I/O troubleshooting; it lists any open files.


If there is "constant" disk activity, then iotop should tell you which process(es) are the culprits. Regarding I/O transaction history: I don't believe IO history is logged anywhere in most Linux distros, but you can add a cron job.

As root, open up crontab with crontab -e and add these two lines:

* * * * * /bin/date >> /var/log/iotop; /usr/local/bin/iotop -bot --iter=3 -q >> /var/log/iotop
* * * * * /bin/date >> /var/log/lsof; /usr/bin/lsof -b -w >> /var/log/lsof

That dumps iotop and lsof output to a log every minute. Add a logrotate script for each to keep the files from taking up all your space, e.g.:

someuser@myhost:~> cat /etc/logrotate.d/lsof
/var/log/lsof {
  rotate 3
share|improve this answer
I think lsof is what I want, I'll try it to see if it shows me the open files. Is there anyway to get a tail of io operations including deletes? – JTew May 28 '12 at 20:43
Looks like you figured it out, but I added some info the my answer if you find it helpful. – Banjer May 29 '12 at 12:41

It appears that an unrelated background task was deleting the contents of the /tmp directory where php was being pre-compiled to. As a result the php pre-compile process started again resulting in constant disk activity.

share|improve this answer
was the background task a custom cron job you created or something by default in RHEL 6? – Banjer May 29 '12 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .