On Fri, Dec 14, 2007 at 12:35:42PM +0100, [EMAIL PROTECTED] wrote: > when installed inside a VServer (http://linux-vserver.org), the use of > ionice in /etc/cron.daily/dlocate fails, and prints to stderr: > ioprio_set: Operation not permitted > > Suggestion: ionice use could be toggled for example in > /etc/default/dlocate, couldn???t it ?
what version of the kernel are you running in vserver? the ionice(1) man page says: Linux supports io scheduling priorities and classes since 2.6.13 with the CFQ io scheduler. i.e. is this a complete incompatibility between ionice and vserver (in which case, the bug should be filed against ionice's package util-linux), or is it due to the kernel version and/or kernel compile-time options (i.e. no CFQ scheduler) that you're running? in either case, i'll either: add a check for kernel version >=2.6.13 or use ionice the same way that /etc/cron.daily/locate does (changing the ionice of the current cron script process and thus all child processes) - since the cron script doesn't have 'set -e', it will still work even if ionice fails. btw, see: http://linux-vserver.org/Frequently_Asked_Questions#Disk_I.2FO_limiting.3F_Is_that_possible.3F Disk I/O limiting? Is that possible? A: Well, since vs2.1.1 Linux-VServer supports a mechanism called 'I/O scheduling', which appeared in the 2.6 mainline some time ago. The mainline kernel offers several I/O schedulers: # cat /sys/block/hdc/queue/scheduler noop [anticipatory] deadline cfq The default is anticipatory a.k.a. "AS". When running several guests on a host you probably want the I/O performance shared in a fair way among the different guests. The kernel comes with a "completely fair queueing" scheduler, CFQ, which can do that. (More on schedulers can be found at http://lwn.net/Articles/114770/) This is how to set the scheduler to "cfq" manually: root# echo "cfq" > /sys/block/hdc/queue/scheduler root# cat /sys/block/hdc/queue/scheduler noop anticipatory deadline [cfq] Keep in mind that you have to do it on all physical discs. So if you run an md-softraid, do it to all physical /dev/hdXYZ discs! If you run Debian there is a predefined way to set the /sys values at boot-time: # apt-get install sysfsutils [...] # grep cfq /etc/sysfs.conf block/sda/queue/scheduler = cfq block/sdc/queue/scheduler = cfq # /etc/init.d/sysfsutils restart For non-vserver processes and CFQ you can set by which key the kernel decides about the fairness: cat /sys/block/hdc/queue/iosched/key_type pgid [tgid] uid gid Hint: The 'key_type'-feature has been removed in the mainline kernel recently. Don't look for it any longer :( The default is tgid, which means to share fairly among process groups. Think every guest is treated like a own process group. It's not possible to set a scheduler strategy within a guest. All processes belonging to the same guest are treated like "noop" within the guest. So: If you run apache and some ftp-server within the _same_ guest, there is no fair scheduling between them, but there is fair scheduling between the whole guest and all other guests. And: It's possible to tune the scheduler parameters in several ways. Have a look at /sys/block/hdc/queue/.... craig -- craig sanders <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]