Hardware: one virtualization server. Dual Nehalem, 24GB RAM, 2 TB mirrored HD.

Software: Debian, KVM, virt-manager on the server with several virtual machines that use Linux too. 2 TB Disk is a big LVM, each VM gets a logical volume and makes its own partitions in that.

Problem: One of the programs that runs on one of the VMs creates huge disk load. This never was an issue, because the program never ran on such a powerful hardware. Now the CPUs are fast, and lots of I/O is the result. We cant do much against that at the moment, because the tool is a black box. On the other hand, the speedy computation is welcome. The program creates about 5 GB of temp files which get overwritten during the next iteration.

Question: How can we limit the disk I/O for the process?

  • I don't know if you can limit the disk I/O, but it may help your server if you decrease the I/O prioroty of that process. If you use the CFQ scheduler, you can do that with ionice. – Prof. Moriarty Apr 27 '10 at 12:04

You want the ionice command. For idle priority (lowest priority):

ionice -c3 bash

You can use the regular nice command to slow down the CPU priority as well which maybe would limit IO as a side effect too.

You might be able to also limit the amount of FDs on the program with ulimit. This might limit the max open files the application is capable of, but it also might just break it.

Yet another option might be to go buy a bunch more memory and map those temp files to a ram disk with mount, taking the load off of the disk entirely. You could of course do the same by adding another disk for the temp files as well.

  • Sounds good. Working on it. – Posipiet Apr 27 '10 at 13:24

RHEL6 will also support cgroups, which lets you do a finer grained tuning. You could try to look that up in Debian as well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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