[mythtv-users] Can you "nice" an I/O process

Tony Lill ajlill at ajlc.waterloo.on.ca
Sat Apr 8 20:40:44 UTC 2006

Brian Wood <beww at beww.org> writes:

> A bit OT, but related to Myth systems.
> I know how you can "nice" a process to control its use of CPU  
> resources. What I am wondering is if there is a similar function with  
> I/O, specifically disk reads/writes ?
> I'd like to be able to start an archive process but have it use less  
> than the normal PCI and IDE system resources, even though it would of  
> course take longer.
I wrote my own version of the cp and cmp commands that included a
nanosleep between reads/writes. By playing with buffer size and sleep
duration, I can turn down the throughput enough not to hose up mythtv.

The problem with linux is that it's very actively trying to do the
opposite of what you want. Various layers of the
disk/filesystem/network all want to gather up as much data as possible
and blast it to the hardware in one media-hosing transfer.

Try this tuning as well. The cfq scheduler is supposed to improve the
fairness between competing I/O streams:

# % of physical memory after which a process doing a write will be paused
# untill dirty pages have been written
# default 40
echo 50 > /proc/sys/vm/dirty_ratio

# % of physical memory at which pdflush will be woken. Hopefull this will limit
# system pauses for flushes
# default 10
echo 5 > /proc/sys/vm/dirty_background_ratio

echo cfq > /sys/block/hda/queue/scheduler
echo cfq > /sys/block/hdc/queue/scheduler
echo cfq > /sys/block/hdd/queue/scheduler

-------------- next part --------------
A non-text attachment was scrubbed...
Name: slowcopy.c
Type: application/octet-stream
Size: 2834 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20060408/0698eac0/attachment.obj 

More information about the mythtv-users mailing list