Gentoo Archives: gentoo-amd64

From: Richard Freeman <rich@××××××××××××××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Use of ionice
Date: Sun, 11 Mar 2007 13:14:21
Message-Id: 45F3FFD8.3000604@thefreemanclan.net
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Not really 64-bit related, but this utility turned out to be so useful
5 for me that I figured I'd pass it on. Especially since many of us
6 64-bitters are running twice as many emerges to maintain our chroots...
7
8 The more recent kernels have a number of IO-scheduling options. I'm
9 using CFQ as my default (kernel option - but if you have support built
10 you can switch it by writing to a file in /sys on a per-drive basis). A
11 few of the schedulers support ionice (emerge schedutils-1.5.0). This is
12 the equivalent of process niceness, but for IO instead of CPU. On my
13 system IO tends to be the more limiting resource, and since I run mythtv
14 I need to be careful not to block recordings with huge emerge runs.
15
16 When using the command "ionice -c 3 nice -n 20 update-world -i" the
17 emerge runs at fairly close to full speed, but the system is completely
18 responsive (even with emerges running in two chroots at the same time).
19 Note that I'm using tmpfs for /var/tmp so you might get a much slower
20 merge if every file has to be written to disk.
21
22 One caution - be careful about running updatedb, prelink, backups, etc
23 in cron jobs using ionice. I'd avoid scheduling these tasks as
24 idle-class, as they can take a VERY long time to run. I'd set them as
25 best-effort, but with a high niceness level (-n 7). I'm not 100% sure,
26 but I think the logic is that processes in different classes (realtime,
27 best-effort, idle) don't compete AT ALL for resources - so if like me
28 you have some commercial flagging jobs or a slow stream of recorded data
29 going to disk the drive won't batch up data and do large flushes, but
30 instead will just write a trickle of data while your idle-class job sits
31 around for hours. It doesn't seem to impact emerge since the writes are
32 going to tmpfs - which may never get written to disk (and when they do
33 it is via swap which probably uses a different algorithm).
34
35 If anybody else has problems with disk contention you should definitely
36 check out ionice.
37 -----BEGIN PGP SIGNATURE-----
38 Version: GnuPG v1.4.6 (GNU/Linux)
39 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
40
41 iD8DBQFF8//YG4/rWKZmVWkRArteAKCNJ0+9m25jZ94pNXPsWHo+bKWscQCgwg99
42 575x694YQFc6q0Hyu/V8jR0=
43 =P1S/
44 -----END PGP SIGNATURE-----

Attachments

File name MIME type
smime.p7s application/x-pkcs7-signature

Replies

Subject Author
Re: [gentoo-amd64] Use of ionice "Boyd Stephen Smith Jr." <bss03@××××××××××.net>