Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 206773

Summary: setting ionice (ioniceness) of portage in the make.conf
Product: Portage Development Reporter: Michael <gent.8.madblock>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement CC: admwiggin, clerke, gentoo.integer, main.haarp, rogerx.oss
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 216231    
Attachments: Adds the ionice (ioniceness) feature
add a PORTAGE_IONICE_COMMAND variable

Description Michael 2008-01-20 13:40:37 UTC
Instead of only PORTAGE_NICENESS it would be nice if one could also set IONICENESS and give the emerge process a lower io-nice value. Because even with low CPU priority, heavy IO can still reduce the responsiveness of the system alot.

Reproducible: Always
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2008-01-21 08:29:57 UTC
This is quite more complicated than nice as AFAIK there is no python function available to do that, and using the external tool (which isn't installed on a base system) is more complicated if the semantics should be the same as with PORTAGE_NICENESS.
In short, if anyone wants to submit a patch for this feature we'll consider it, but I don't think we'll implement this on our own.
Comment 2 Matthias L├╝bben 2008-05-03 20:14:03 UTC
Created attachment 151724 [details, diff]
Adds the ionice (ioniceness) feature

Setting ionice (ioniceness) for portage in /etc/make.conf
PORTAGE_IONICE_CLASS=<realtime|besteffort|idle|none>
PORTAGE_IONICE_PRIO=<0..7>

If the program ionice is not installed on the system, nothing happens. If the settings are not defined in make.conf, nothing happens. If the settings contain invalid values a message is printed. The binary must be located in PATH.
Comment 3 Roger 2008-07-11 00:56:19 UTC
I second this, along with a "nice network io limiting" feature.

Such as when emerge fetches, it hogs the entire network and makes browsing with firefox/browser unbearably slow!!!

/me casts my vote for this FEATURE!
Comment 4 Roger 2008-07-11 01:09:51 UTC
Looks like the network limiting is already taken care of.  Sorry.
(http://gentoo-wiki.com/Emerge/Limit_bandwidth)

This ionice feature really needs to be integrated.
Comment 5 Roger 2008-07-11 01:33:26 UTC
As I tend to also like to use nice (as well as ionice) on /etc/cron.d processes, just finished integrating ionice into cron.  

According to:
http://gentoo-wiki.com/HOWTO_Light_Gentoo_Installation

I added an nice alias to /root/.bashrc including ionice according to the above url ionice tip.  Felt creating a new /bin/nice was more of a hack.  At least using /root/.bashrc is less of a hack, but still easily/commonly a lost/forgotten setting!

Might be nice to just use "nice" alias/variable throughout the /etc/cron.d files as well /etc/make.conf.  And then create a system wide /etc/nice.conf setting how the admin wants this computer, whether server or client, to react when running root services such as emerge processes (such as sync or regular emerge) or when cron services are run such as /etc/cron.d/weekly/prelink,  /etc/cron.d/weekly/locate, etc... <shrugs> ...  just my random thoughts on centralizing this tools customizations.  Might also be a great idea to include user io quotas within such a file as /etc/nice.conf.  <shrugs> 
Comment 6 Zac Medico gentoo-dev 2008-07-24 14:46:33 UTC
Created attachment 161266 [details, diff]
add a PORTAGE_IONICE_COMMAND variable

Add a new PORTAGE_IONICE_COMMAND variable that emerge uses to adjust ionice priority, similar to PORTAGE_NICENESS but used more like FETCHCOMMAND since so that portage doesn't have to know anything about ionice options. The command should include a \${PID} place-holder to be substituted with an integer pid.
Comment 7 Zac Medico gentoo-dev 2008-07-24 14:47:33 UTC
The PORTAGE_IONICE_COMMAND patch is in svn.
Comment 8 Roger 2008-07-24 23:18:28 UTC
Sweet!  Think a lot of people are going to enjoy this feature!

I've worked my systems over here utilizing ionice already.  Love having a system that is still usable for compiling, etc, even while syncing remote & local Portages across my platforms.  (I've also familarized myself with network bandwidth quota using wget's custom command options within /etc/make.conf recently.  Although, it'd probably be nicer seeing a simpler system wide equivalent of ionice for network bandwidth quotas then manually messing with network stack.)

Comment 9 Zac Medico gentoo-dev 2008-07-28 10:41:31 UTC
This is fixed in 2.2_rc4.
Comment 10 Roger 2008-08-02 18:38:27 UTC
And, if I'm not mistaken since =sys-apps/portage-2.1.5.6 is now the first successive version release since rc4, it's now in "2.1.5.6" correct?

Err.  Or should this feature be included in portage-2.3 release?

(BTW, been on rc4 and it builds, works and does not seem to complain about the IONICE function in make.conf.  Whether it's actually using it, i can't tell.)
Comment 11 Zac Medico gentoo-dev 2008-08-02 22:18:10 UTC
portage-2.1.5.6 is an older (dead) branch and doesn't contain any new stuff, except a few things that are new relative to 2.1.4.4. You have to use a 2.2_rc release to get the latest features.

Also, PORTAGE_IONICE_COMMAND is disabled by default now (since 2.2_rc6) because the behavior of various kernels wrt user privileges and ionice varies too much (with some kernels you have to be root and emerge can do lots of things without being root, like --buildpkgonly).
Comment 12 Roger 2008-08-08 01:34:17 UTC
"Also, PORTAGE_IONICE_COMMAND is disabled by default now (since 2.2_rc6)"

In otherwords, PORTAGE_IONICE_COMMAND is commented-out within /etc/make.conf, hence, leaving it unactive until removing the comment/pound sign character?
Comment 13 Zac Medico gentoo-dev 2008-08-08 03:32:52 UTC
Right, you need something like this in make.conf to enable it:

PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"