How can I limit a process' disk io bandwith
I need to run an archiving process that is cpu and disk io intensive.
It is easy to make sure it does not steal the cpu from more important processes: nice myprocess However, even when running at a lower priority (thanks to nice) it manages to generate enough disk io to impact the performance of more important processes. I would like to be able to limit the process disk io to e.g. 10Mbyte/sec; alternatively, to 10% of the available bandwidth. ulimit does not seem to have such option. Is there another command ? Can I do that programmatically (i.e. write my own command ... but then someone must have wrote one already)? |
The usual answer here is to run the archive as a cron job. Set it to run at 2am (or whenever the machine has little use) and that way you can give it all the resources it wants without interfering with your daily tasks.
|
This machine runs 24X7
|
Quote:
Create shared library slow_io.so with functions read and write. Those funcion should usleep(your_timeout) and then call, original one Run your application as Code:
LD_PRELOAD=slow_io.so YourApplication |
"man ionice"
|
Quote:
|
just what i need, only available from 2.6.13 and up though.
|
All times are GMT -5. The time now is 09:15 PM. |