[Rpm-maint] [PATCH] Reset nice and ionice priorities.

Panu Matilainen pmatilai at laiskiainen.org
Tue Apr 7 09:31:18 UTC 2015


On 03/31/2015 10:08 PM, David Martínez Moreno wrote:
>      Hello, first post to the list!  It's no secret that at Facebook we
> use internally CentOS and we discovered a nasty side effect of dealing
> with it.
>
>      In order to alleviate the CPU & I/O needed for e.g. multi-package
> upgrades in our servers, some months we considered running an entire yum
> upgrade wrapped on nice and ionice to soften the effect of the upcoming
> storm on the system.  It was great until we found unrelated services
> running on a weird nice level.
>
>      The reason was that fork() translates the nice/ionice priorites to
> its children.  Think about e.g. sshd being nice'd, and then think about
> installing and starting some random service through an automated SSH
> connection.

>
>      I am proud to be the first pull request in your shiny new Github
> repo. :-D https://github.com/rpm-software-management/rpm/pull/1 is our
> solution to this.  With it, you are safe to run rpm in such a wrapper,
> because we will reset nice and ionice values right after fork() to the
> system defaults.
>
>      I have a patch against 4.8.0-38.el6_6 but I don't think anyone else
> will want it. ;-)

The problem I see is that scriptlets can be quite io- and cpu-heavy too, 
so if you're running rpm/yum with niced priorities you'd really want the 
scriptlets to run niced too.

Overall this is generic problem with anything interited over fork 
combined with init systems of old, its come up before wrt umask at least 
and probably selinux too. Regardless of what one otherwise thinks of 
systemd, this is one of the things it fixes since the services are 
(re)started by systemd and not the process happening to call the service 
command / script.

	- Panu -



More information about the Rpm-maint mailing list