1

So I recently went from apache2 with mod_php to apache2 with fastcgi and php5-fpm. (still same prefork module).

But I am not sure if we have configured php5-fpm properly.

We don't run a website but it is more of a PHP backend for a smartphone game. This means no static content but lots of dynamic content.

Usually during the day we have around 5000 players but at peak times it goes above 15000 and this is where our server gets slow. That was a reason why we wanted to try our luck with php5-fpm.

Right now with only around 6000 players we have 50 php5-fpm processes and all of them are sleeping but 2! I checked with top.

This is the php5-fpm config:

[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.group = www-data

pm = dynamic
pm.max_children = 600
pm.start_servers = 20
pm.min_spare_servers = 1
pm.max_spare_servers = 100
pm.max_requests = 500

request_terminate_timeout = 10s
rlimit_files = 5000
chdir = /

Our server is a Dual Processor Hex Core Xeon 2620 - 2.00GHz (Sandy Bridge) and 64 GB RAM. Right now 64% is used for mysql. If you have any suggestion or need other config files, let me know.

Any suggestions on the config file is greatly appreciated! Thanks!

In the future I want to go with a setup with only nginx and php5-fpm. Would you recommend that?

Your Answer

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

Browse other questions tagged or ask your own question.