fpm_children_bury() problem

513 views
Skip to first unread message

lnxa

unread,
Jan 9, 2010, 7:42:02 AM1/9/10
to highloa...@googlegroups.com
centos 5.3
nginx-0.8.31-1.el5
php-fpm-5.2.11

# /etc/init.d/php-fpm start
php-fpm.log messages


Jan 08 10:55:22.912284 fpm_unix_init_main(), line 284: getrlimit(nofile): max:1024, cur:1024
Jan 08 10:55:22.913126 fpm_event_init_main(), line 88: libevent: using epoll
Jan 08 10:55:22.913404 fpm_init(), line 50: fpm is running, pid 2730
Jan 08 10:55:22.918493 fpm_children_make(), line 352: child 2731 (pool default) started
Jan 08 10:55:22.922118 fpm_children_make(), line 352: child 2732 (pool default) started
Jan 08 10:55:22.924813 fpm_children_make(), line 352: child 2734 (pool default) started
Jan 08 10:55:22.927509 fpm_children_make(), line 352: child 2735 (pool default) started
Jan 08 10:55:22.929378 fpm_children_make(), line 352: child 2736 (pool default) started
Jan 08 10:55:22.930268 fpm_event_loop(), line 107: libevent: entering main loop


when I stop php-fpm
# /etc/init.d/php-fpm stop
php-fpm.log will has " fpm_children_bury() ..." messages

Jan 08 10:56:22.516549 fpm_got_signal(), line 56: received SIGTERM
Jan 08 10:56:22.516620 fpm_pctl(), line 256: switching to ‘terminating’ state
Jan 08 10:56:22.516666 fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2736 (pool default)
Jan 08 10:56:22.516707 fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2735 (pool default)
Jan 08 10:56:22.516729 fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2734 (pool default)
Jan 08 10:56:22.516747 fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2732 (pool default)
Jan 08 10:56:22.516765 fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2731 (pool default)
Jan 08 10:56:22.516778 fpm_pctl_kill_all(), line 181: 5 children are still alive
Jan 08 10:56:22.517532 fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.517620 fpm_children_bury(), line 215: child 2736 (pool default) exited on signal 15 SIGTERM after 59.588363 seconds from start
Jan 08 10:56:22.518131 fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.518195 fpm_children_bury(), line 215: child 2735 (pool default) exited on signal 15 SIGTERM after 59.590726 seconds from start
Jan 08 10:56:22.518906 fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.518969 fpm_children_bury(), line 215: child 2734 (pool default) exited on signal 15 SIGTERM after 59.594192 seconds from start
Jan 08 10:56:22.519518 fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.519580 fpm_children_bury(), line 215: child 2732 (pool default) exited on signal 15 SIGTERM after 59.597517 seconds from start
Jan 08 10:56:22.520107 fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.520159 fpm_children_bury(), line 215: child 2731 (pool default) exited on signal 15 SIGTERM after 59.601726 seconds from start
Jan 08 10:56:22.520193 fpm_pctl_exit(), line 81: exiting, bye-bye!


Is the php-fpm setting has any problem?

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,39076,39076#msg-39076

Michael Shadle

unread,
Jan 9, 2010, 6:30:14 PM1/9/10
to highloa...@googlegroups.com
On Sat, Jan 9, 2010 at 4:42 AM, lnxa <nginx...@nginx.us> wrote:

> Jan 08 10:56:22.518969  fpm_children_bury(), line 215: child 2734 (pool default) exited on signal 15 SIGTERM after 59.594192 seconds from start

> Is the php-fpm setting has any problem?

recycling after 60 seconds is pretty quick.

what is your max_requests setting and how many children do you have configured?

that is normal behavior, it is simply recycling the children (php does
this by design to clean up any memory leaks)

lnxa

unread,
Jan 9, 2010, 6:42:45 PM1/9/10
to highloa...@googlegroups.com

Michael Shadle

unread,
Jan 9, 2010, 6:50:08 PM1/9/10
to highloa...@googlegroups.com
102,400 requests and you're still going through a child at 60 seconds?

that would mean you're doing approximately 1706 requests/second... i
wouldn't think you could support that many with only 5 children.

lnxa

unread,
Jan 9, 2010, 7:27:40 PM1/9/10
to highloa...@googlegroups.com
my vps server is 128 ram only!
mike! max_requests, max_children how to set?

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,39076,39270#msg-39270

Michael Shadle

unread,
Jan 9, 2010, 7:29:16 PM1/9/10
to highloa...@googlegroups.com
can you pastebin your php-fpm.conf?

putting it in email strips it out at least in gmail.

perhaps you configured apache_like instead of static (in which case
it's totally ignored :))

lnxa

unread,
Jan 9, 2010, 8:09:48 PM1/9/10
to highloa...@googlegroups.com

<?xml version="1.0" ?>


All relative paths in this config are relative to php's install prefix

Pid file
/var/run/php-fpm.pid

Error log file
/var/log/php-fpm.log

Log level
notice

When this amount of php processes exited with SIGSEGV or SIGBUS ...
10

... in a less than this interval of time, a graceful restart will be initiated.
Useful to work around accidental curruptions in accelerator's shared memory.
1m

Time limit on waiting child's reaction on signals from master
5s

Set to 'no' to debug fpm
yes

Name of pool. Used in logs and stats.
default

Address to accept fastcgi requests on.
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
127.0.0.1:9000

Set listen(2) backlog
-1

Set permissions for unix socket, if one used.
In Linux read/write permissions must be set in order to allow connections from web server.
Many BSD-derrived systems allow connections regardless of permissions.


0666

Additional php.ini defines, specific to this pool of workers.

/usr/sbin/sendmail -t -i
1

Unix user of processes
nobody

Unix group of processes
nobody

Process manager settings

Sets style of controling worker process count.
Valid values are 'static' and 'apache-like'
static

Sets the limit on the number of simultaneous requests that will be served.
Equivalent to Apache MaxClients directive.
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
Used with any pm_style.
5

Settings group for 'apache-like' pm style

Sets the number of server processes created on startup.
Used only when 'apache-like' pm_style is selected
20

Sets the desired minimum number of idle server processes.
Used only when 'apache-like' pm_style is selected
5

Sets the desired maximum number of idle server processes.
Used only when 'apache-like' pm_style is selected
35

The timeout (in seconds) for serving a single request after which the worker process will be terminated
Should be used when 'max_execution_time' ini option does not stop script execution for some reason
'0s' means 'off'
0s

The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
0s

The log file for slow requests
logs/slow.log

Set open file desc rlimit
65535

Set max core size rlimit
0

Chroot to this directory at the start, absolute path

Chdir to this directory at the start, absolute path

Redirect workers' stdout and stderr into main error log.
If not set, they will be redirected to /dev/null, according to FastCGI specs
yes

How much requests each process should execute before respawn.
Useful to work around memory leaks in 3rd party libraries.
For endless request processing please specify 0
Equivalent to PHP_FCGI_MAX_REQUESTS
102400

Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
Makes sense only with AF_INET listening socket.
127.0.0.1

Pass environment variables like LD_LIBRARY_PATH
All $VARIABLEs are taken from current environment

$HOSTNAME
/usr/local/bin:/usr/bin:/bin
/tmp
/tmp
/tmp
$OSTYPE
$MACHTYPE
2

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,39076,39283#msg-39283

Michael Shadle

unread,
Jan 9, 2010, 8:32:48 PM1/9/10
to highloa...@googlegroups.com, highloa...@googlegroups.com
I said pastebin. The XML is stripped in gmail :)

It does look like you have 5 children with 102400 requests apiece.
That's pretty unbalanced. I think the usual amount of requests people
have is 500. Perhaps increase your children to 10 and your requests to
1000?

However it still means you're doing an insane amount of requests a
second to be cycling through 102400 requests in a minute. That still
confuses me.

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages