1

I'm setting up a Centos 6.5 server with the latest version of Plesk (12) which finally has support for php-fpm. I have enabled it and have set nginx to use phpfpm which is all fine.

What I cant work out is how to alter the settings. By default, the vhost settings which are loaded to;

etc/php-fpm.d/example.com.conf

Are;

; By default use ondemand spawning (this requires php-fpm >= 5.3.9)
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
; Following pm.* options are used only when 'pm = dynamic'
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1

I want to change this to dynamic and increase servers (im running php-fpm 5.3.3, so im probably running in dynamic mode anyway but with just 1 server).

From the very limited documentation I have found, I created a php.ini file here;

var/www/vhosts/system/exmaple.com/conf/php.ini

In this file I have added these test settings;

[php-fpm-pool-settings]
pm = dynamic
pm.max_children = 100
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 498

In Plesk, if I go an create and save a custom php directive on the domains control panel, it recompiles the .conf file so now it has;

 ; By default use ondemand spawning (this requires php-fpm >= 5.3.9)
 pm = ondemand
 pm.max_children = 5
 pm.process_idle_timeout = 10s
 ; Following pm.* options are used only when 'pm = dynamic'
 pm.start_servers = 1
 pm.min_spare_servers = 1
 pm.max_spare_servers = 1

; Following directives override default pool configuration
pm.max_spare_servers = 20
pm.min_spare_servers = 5
pm.max_requests = 498
pm.start_servers = 10
pm.max_children = 100
pm = dynamic

However, when I run top in SSH, I dont have any pool fpm services running. If I go and hit the website, it spawns a php-fpm service, but I am expecting to see some pool ones ready and waiting to serve the users.

What am I missing?

PixieMedia
  • 1,548
  • 1
  • 9
  • 15
  • it's quite strange, your settings working(10 php-fpm processes spawned after applying settings) for me on Centos 6.6 with default php-fpm-5.3.3-40.el6_6.x86_64. What if php-fpm is not restarted? – Oleg Neumyvakin Feb 05 '15 at 09:16
  • It is weird. Yes I am restarting php-fpm after the .conf file is generated - im pretty sure Plesk does this when it regens the file, but always worth a go manually. Can I ask how you are testing for the presence of the 10 processes? – PixieMedia Feb 05 '15 at 16:13
  • I've create php.ini file with your settings, just update PHP settings in Panel GUI, and "ps afvx | grep my-domain.tld" - it's shows me ten php-fpm processes with pool name equivalent to my domain name. The content of php-fpm pool config is the same as your one. – Oleg Neumyvakin Feb 06 '15 at 05:28

0 Answers0