Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Limit number of cores used by emerge?
Date: Fri, 30 Sep 2011 16:56:29
Message-Id: 4E85F47C.9070307@gmail.com
In Reply to: [gentoo-user] Limit number of cores used by emerge? by Mark Knecht
1 Mark Knecht wrote:
2 > Hi,
3 > Is there a portage option that will limit the number of cores used
4 > by emerge? For instance, in a chroot on a 12 core machine I want to
5 > limit emerge to not using more than 3 cores?
6 >
7 > If possible, I'd also like to limit the total disk bandwidth
8 > consumption during emerge. For instance, when untarring a big file to
9 > do the emerge at times the disk consumption gets to high and the
10 > machine becomes laggy. Is there an option that addresses this?
11 >
12 > These questions are mostly about being able to update a chroot
13 > mid-day without other tasks slowing down too much. I don't care how
14 > long the chroot really takes to get a huge emerge done, but rathe just
15 > keeping the machine very responsive while it's happening. I already
16 > use:
17 >
18 > MAKEOPTS="-j3"
19 > PORTAGE_NICENESS="15"
20 >
21 > which helps (I think) but it doesn't totally address either of the issues above.
22 >
23 > Thanks,
24 > Mark
25 >
26 >
27
28 This may help:
29
30 PORTAGE_IONICE_COMMAND="ionice -c -3 -p \${PID}"
31
32 Make sure you have util-linux installed since it has the ionice
33 command. I think you have to have it enabled in the kernel as well.
34 I'm not certain tho.
35
36 On my machine, even if I tell emerge to only do one job at a time, it
37 still staggers around the cores. I guess it makes the CPU heat spread
38 out evenly or something.
39
40 Hope that helps.
41
42 Dale
43
44 :-) :-)

Replies

Subject Author
Re: [gentoo-user] Limit number of cores used by emerge? Michael Mol <mikemol@×××××.com>