1

What is the largest value one may set the priority limit to in limits.conf? I came across a script that adds the entry, admin hard priority 50, but this simply results in the nice being set to 19. From googling, I found references to both 19 and 20 being the largest value. Is there any authoritative source that defines the range of values for this setting? The limits.conf man page doesn't say.

If it matters, I develop on Ubuntu (where I play around a lot) but often target CentOS (where it really matters).

4

According to setpriority(2), the allowed range of priorities on Linux is -20 to 19 since kernel 1.3.43. Other systems (unnamed) allow -20 to 20. POSIX says the range is ‑NZERO to NZERO‑1; the minimum acceptable value for NZERO is 20.

(-20 is the highest priority, 19 the lowest.)

  • Thanks. FWIW, I also just found on the renice man page for Ubuntu (kernel 4.4.0), "The superuser may alter the priority of any process and set the priority to any value in the range -20 to 19." The renice man page for CentOS (kernel 2.6.32) says, "...PRIO_MAX (20). ... The super-user may alter the priority of any process and set the priority to any value in the range PRIO_MIN (-20) to PRIO_MAX." – plong Aug 4 '16 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.