Add process.priority to set nice(2) priorities

 [2012-05-25 17:26 UTC] geeky at geeky dot de

Description:
------------
It would be nice if a pool could be set to "low priority pool" (or even set a 
priority).

Example: a website consisting of two parts:
(1) frontend: responsive-time is essential here
(2) background-synchronisation: should not slow down frontend, response-time is 
not important.

In this case the background-pool should only use minimal/unused cpu-time in order 
to keep the frontend-pool at full speed.


 [2012-05-25 19:27 UTC] fat@php.net

-Status: Open +Status: Analyzed -Assigned To: +Assigned To: fat

 [2012-05-25 19:29 UTC] fat@php.net

FPM is not design to manage priority between its processes. It just 
stop/start/restart/watch them.

One thing which can be done is to play with nice(2) or setpriority(2).

We can add a priority=[-19,20] parameter in the configuration file for each pool 
and the corresponding priority will be set when processes will be created.

Is that something that can fit your needs ?

thx for the answer.

++ fat

 [2012-05-25 19:44 UTC] geeky at geeky dot de

Yes, that would be perfect

 [2012-05-26 16:21 UTC] fat@php.net

-Summary: Add Option: Low-Priority Pool +Summary: Add process.priority to set nice(2) priorities

 [2012-05-26 16:26 UTC] fat@php.net

-Status: Analyzed +Status: Closed

 [2012-05-26 16:26 UTC] fat@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Added process.priority to [general] and to pools section in the configuration 
file.

[general]
...
process.priority = 4
...
[pool_high_prio]
...
process.priority = -15
...
[pool_low_prio]
...
process.priority = 15
...