0

I have the following server:

Intel® Xeon® E3-1270 v2 Single Processor - Quad Core Dedicated Server
CPU Speed: 4 x 3.5 Ghz w/ 8MB Smart Cache
Motherboard: SuperMicro X9SCM-F
Total Cores: 4 Cores + 8 Threads
RAM: 32 GB DDR3 1333 ECC
Hard Drive: 120GB
Smart Cache: 8MB

I am using ubuntu 12.04 - nginx, php, mysql with ISPConfig 3.

Under ISPConfig 3 >> website settings:

I have this default value:

PHP-FPM pm.max_children = 10
PHP-FPM pm.start_servers = 2
PHP-FPM pm.min_spare_servers = 1
PHP-FPM pm.max_spare_servers = 5
PHP-FPM pm.max_requests = 0

My question is what is the recommended settings for the above variable? Because I found some using a different settings.

  • 1
    If there were One True Configuration, these would be hardcoded. The point is that you tune them for what you're trying to do. – Falcon Momot Jul 2 '13 at 2:34
3

The best advice? Benchmark it!

Set up your app or install some kind of CMS (e.g. Drupal and hit it with search queries after generating a lot of content and stuff with Devel) and start hitting it with Apache bench or siege. Start fiddling around with the settings.

Personally I consider the following a good starting point:

pm = dynamic
pm.max_children = 8
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4

To find out how many are running execute ps aux | grep php

0

Started off as a comment but it got a bit long.

The recommended setting is the right setting for your setup / traffic.

It's less of a problem on Linux than other Unixen as forking a process on Linux is much faster, but it does have an impact on performance. Really you need to monitor the number of php processes running and tune the parameters to minimize the need to fork new instances (although it's arguable that a small amount of turnover in the processes will mitigate the impact of any memory leaks).

Having min_spare_servers less than start_servers doesn't make much sense.

  • How do I know the number of php processes running? I read the php manual and the computation of start_servers is Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. – jaypabs Jul 1 '13 at 12:40

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