S
S
Sergei Iamskoi2015-07-14 11:24:46
PHP
Sergei Iamskoi, 2015-07-14 11:24:46

What php-fpm settings should I use?

There is a dedicated production server with the following configuration:
Intel® Core™ i7-920 Quadcore - 4 cores, 48 ​​GB DDR3 RAM, 2 x 2 TB 6 Gb/s SATA 7200 rpm/Enterprise
OS Debian 7
Googled a lot of information, configured php-fpm as recommended online, it looks like this:


pm = dynamic
pm.max_children = 200
pm.start_servers = 12
pm.min_spare_servers = 8
pm.max_spare_servers = 16

Those. I want to allocate 10000 Mb for php for now, taking with a margin the memory usage per process of 50Mb: 10000/50 = 200 max_children. Other parameters are selected from the simplest recommended formulas on the Internet: min_spare_servers = number_cores * 2, max_spare_servers = number_cores * 4, and start_servers = min_spare_servers + (max_spare_servers - min_spare_servers) / 2.
But one fig in the error logs:

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 7 idle, and 29 total children
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 7 idle, and 28 total children
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min /max_spare_servers), spawning 8 children, there are 6 idle, and 55 total children
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 7 idle, and 64 total children

So how to correctly calculate and set these parameters?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergei Iamskoi, 2015-07-14
@syamskoy

It's decided. The brakes were caused by sending mail and hanging scripts for several minutes.

N
Nazar Mokrinsky, 2015-07-14
@nazarpc

Maybe it's time to look towards HHVM?) If the code is adequately written, then there shouldn't be any big difficulties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question