The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #1381

Add nice option to 'exec' type

Added by Lawrence Ludwig almost 6 years ago. Updated 11 months ago.

Status:ClosedStart date:06/30/2008
Priority:LowDue date:
Assignee:-% Done:

0%

Category:exec
Target version:-
Affected Puppet version:0.24.4 Branch:
Keywords:exec nice

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

It would be nice to ‘nice’ a program before it starts. That way any application you run with puppet (ie compiling) can be NICEd to a lower priority and not hog too many resources. I propose something like this:

exec { "gcc test.c":
     nice => 15,
}

this would nice the @gcc test.c@ to a level of 15. If ran manually it would look like this.

nice 15 gcc test.c

Also if possible it would be great if a global wide option for puppet can ‘nice’ all external applications run (either via ‘exec’ type or other types that call external programs (ie ‘package’ type that calls ‘yum’).

IMHO what matters is puppet creates a correct configuration, not how fast it runs.


Related issues

Related to Puppet - Feature #21241: Add the ability to specify the nice/priority level of puppet Closed

History

#1 Updated by Adam Jacob almost 6 years ago

I’m not sure I think this is a good idea. If you have specific commands that you know are causing trouble, slipping a “nice” in front of the exec is already totally supported.

If you aren’t having trouble with specific commands, just “nice”-ing everything feels like a superbly premature activity.

What’s your use-case for this?

Adam

#2 Updated by James Turnbull almost 6 years ago

  • Category set to exec
  • Keywords set to exec nice

Ah – what Adam said. Was in the midst of typing that. :)

#3 Updated by James Turnbull almost 6 years ago

  • Status changed from Unreviewed to Rejected

I think this one is a “Rejected”. As per Adam’s comment – you can just prefix your exec with “nice” already.

#4 Updated by Lawrence Ludwig almost 6 years ago

jamtur01 wrote:

I think this one is a “Rejected”. As per Adam’s comment – you can just prefix your exec with “nice” already.

In the end this is fine per ‘exec’ type but I do think it’s valid for a puppetd wide setting.

One use case is for: – yum updates

Or any type that executes an external application in puppetd. Right now we have no control of these other than patching the puppet code. There should be some method to slow down these forked applications if we want to.

This submission was per Luke’s request in a private email discussion with him.

#5 Updated by James Turnbull almost 6 years ago

  • Status changed from Rejected to Accepted
  • Assignee set to Luke Kanies
  • Target version set to 4

Okay – I’ll assign to Luke. Personally I don’t see the benefit but up to him.

#6 Updated by Luke Kanies almost 6 years ago

  • Assignee changed from Luke Kanies to Puppet Community

I’ll accept this, because I agree in principle, but, well, it’s wicked-low on the priority list.

It makes more sense as a general feature — either nice everything or nothing — but in that case, it also makes more sense to just nice puppetd in the first place.

#7 Updated by Lawrence Ludwig almost 6 years ago

luke wrote:

I’ll accept this, because I agree in principle, but, well, it’s wicked-low on the priority list.

It makes more sense as a general feature — either nice everything or nothing — but in that case, it also makes more sense to just nice puppetd in the first place.

Yea it’s super low. If you nice puppetd will that for forked processes?

#8 Updated by Luke Kanies almost 6 years ago

Not sure; care to test? I assume processes do inherit their niceness, though.

#9 Updated by Lawrence Ludwig almost 6 years ago

luke wrote:

Not sure; care to test? I assume processes do inherit their niceness, though.

based upon this page:

http://www.mkssoftware.com/docs/man3/fork.3.asp

I assume also, I will test to confirm.

#10 Updated by Lawrence Ludwig almost 6 years ago

lludwig wrote:

I assume also, I will test to confirm.

confirmed on CentOS 4.6 64-bit.

#11 Updated by James Turnbull almost 5 years ago

  • Assignee deleted (Puppet Community)

#12 Updated by James Turnbull over 2 years ago

  • Target version deleted (4)

#13 Updated by Andrew Parker 11 months ago

  • Status changed from Accepted to Closed

Since the ‘nice’ for exec types had already been rejected by both Adam and James, and the children of a process inherit the nice levels of the parent, I’m going to close this. I see no reason for puppet to try and implement this.

Also available in: Atom PDF