PHP-FPM Question in CB 2.0

nmb

Verified User
Joined
Sep 13, 2008
Messages
223
I just tried to install Custombuild 2.0 and got a few questions below :

1. When update, etc. Will The config file in /usr/local/directadmin/data/users/*/php/php-fpm53(54).conf be overwrite? I have set my custom config there and would like to know that.
2. Why the default config for PHP-FPM is dynamic instead of ondemand? With Shared hosting, ondemand would be a perfect match similar to suPHP that will fork a process once there is a request.
3. When I set php to 5.3 and 5.4 with PHP-FPM, the php 5.4 will be downloaded only when I run ./build php , not ./build update .
 
Last edited:
Hello,

1) Yes, it will be overwritten anytime the httpd.conf is overwritten.
It uses the template:
/usr/local/directadmin/data/templates/php-fpm.conf

so you can copy it to:
/usr/local/directadmin/data/templates/custom/php-fpm.conf

and make all the changes you want, just like the virtual_host2.conf files.
It should support full tokens and if-then-else statements, and likely php or /bin/sh scripting (as root).

There are also 2 custom tokens:
|CUSTOM1|
|CUSTOM2|

which are currently set as "" (blank) for now, but we'll likely add an interface into DA to let you insert code there (just like Admin Level -> Custom Httpd Config) in a future DA version.

2) I've looked over the documenation, and ondemand may be a good option, just as long as we set the pm.process_idle_timeout to a decent value.. 10s may not be high enough (time before the forked child dies).
The point of the php-fpm was to keep each server running so that php files can be served up quickly. For any low traffic sites, we don't care much anyway, but for higher-traffic sites, we'd need to ensure the servers don't die.
The huge upside with ondemand would be that memory usage would probably be something like 5% of what it is with dynamic.. so if you have many Users, one almost needs to use ondemand.
I'll leave this open for discussion for now, but seems like a good replacement.

3) Added that download to the update_data function (called via ./build update).
I'll be uploading it shortly, along with a few other changes/fixes.

John
 
2) I've looked over the documenation, and ondemand may be a good option, just as long as we set the pm.process_idle_timeout to a decent value.. 10s may not be high enough (time before the forked child dies).
The point of the php-fpm was to keep each server running so that php files can be served up quickly. For any low traffic sites, we don't care much anyway, but for higher-traffic sites, we'd need to ensure the servers don't die.
The huge upside with ondemand would be that memory usage would probably be something like 5% of what it is with dynamic.. so if you have many Users, one almost needs to use ondemand.
I'll leave this open for discussion for now, but seems like a good replacement.

How about set it to Ondemand, and set the pm.process_idle_timeout to 60 seconds. For the high traffic site, it should be enough to wait for the next request but it will still kill itself for low traffic site. If you can manage to allow us to set those values (pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers) in DirectAdmin GUI, that would be the best but I think it's kind of difficult to do it.
 
There are also 2 custom tokens:
|CUSTOM1|
|CUSTOM2|

which are currently set as "" (blank) for now, but we'll likely add an interface into DA to let you insert code there (just like Admin Level -> Custom Httpd Config) in a future DA version.
Where do we fill these variables?
Simply create domain.tld.cust_php and add our content to |?CUSTOM2=|?
 
Back
Top