Hung php-fpm

0 like 0 dislike
8 views
environment: Debian Lenny, nginx, php-fpm (VDS: 720 MHz/384 Mb/12 Gb)

php often hangs with error in logs:
[pool www] server reached max_children setting(50), consaider raising it

helps only restart php, captain obvious tells to do what is asked, i.e. to increase the number of childrenof, but actually there are two questions:

1. If all children busy, I used to love php? according to the logic of nginx should give 503 error and wait-free processes

2. How to calculate the optimal number of childrenof for vds'key?
by | 8 views

3 Answers

0 like 0 dislike
The optimum amount depends on the project, but 50 — much more than is needed to carried away configuration.
\r
When childrenof getting so much, what are they doing? If they can wait for a response from external services, which they hold responsible?
by
0 like 0 dislike
The optimal number of children is determined by the PHP practically
theoretically it should be x2 kids nginx.
\r
Look at the time spent on testing a single script.
If the scripts are heavy, and need to get rid of as soon as possible, children PHP must be equal to the reserve ratio of the failover script, and the frequency of incoming requests.
by
0 like 0 dislike
I have a few pools:
\r
/etc/nginx/nginx.conf
===
...
upstream backend
{
server unix:/tmp/fcgi1.sock weight=100 max_fails=10
fail_timeout=5;
server unix:/tmp/fcgi2.sock weight=100 max_fails=10
fail_timeout=5;
server unix:/tmp/fcgi3.sock weight=100 max_fails=10
fail_timeout=5;
}
...
location ~ \\.php$ { ## Execute PHP scripts
expires off; ## Do not cache dynamic content
location backend;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
...
===
\r
/etc/php-fpm.conf
===
section name="pool"
value name="name">default1/value
value name="listen_address">/tmp/fcgi1.sock /value
\r
section name="pool"
value name="name">default2/value
value name="listen_address">/tmp/fcgi2.sock /value
\r
section name="pool"
value name="name">default3/value
value name="listen_address">/tmp/fcgi3.sock /value
===
configure each pool is the same.
\r
p.s. the parser eats the signs "<"">"
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked May 22, 2019 by Vetall0779
0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
asked Mar 25, 2019 by yitzhakv
0 like 0 dislike
3 answers
asked Apr 5, 2019 by polyanin
110,608 questions
257,186 answers
0 comments
28,760 users