Welcome! Log In Create A New Profile

Advanced

fpm_children_bury() problem

Posted by lnxa 
fpm_children_bury() problem
January 09, 2010 07:42AM
centos 5.3
nginx-0.8.31-1.el5
php-fpm-5.2.11

# /etc/init.d/php-fpm start
[b]php-fpm.log messages[/b]
[code]

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

when I stop php-fpm
# /etc/init.d/php-fpm stop
php-fpm.log will has "[b][WARNING] fpm_children_bury() ..." messages [/b]
[code]
Jan 08 10:56:22.516549 [NOTICE] fpm_got_signal(), line 56: received SIGTERM
Jan 08 10:56:22.516620 [NOTICE] fpm_pctl(), line 256: switching to ‘terminating’ state
Jan 08 10:56:22.516666 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2736 (pool default)
Jan 08 10:56:22.516707 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2735 (pool default)
Jan 08 10:56:22.516729 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2734 (pool default)
Jan 08 10:56:22.516747 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2732 (pool default)
Jan 08 10:56:22.516765 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 2731 (pool default)
Jan 08 10:56:22.516778 [NOTICE] fpm_pctl_kill_all(), line 181: 5 children are still alive
Jan 08 10:56:22.517532 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.517620 [WARNING] 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 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.518195 [WARNING] 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 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.518969 [WARNING] 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 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.519580 [WARNING] 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 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jan 08 10:56:22.520159 [WARNING] 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 [NOTICE] fpm_pctl_exit(), line 81: exiting, bye-bye!
[/code]

Is the php-fpm setting has any problem?
Re: fpm_children_bury() problem
January 09, 2010 06:32PM
On Sat, Jan 9, 2010 at 4:42 AM, lnxa <nginx-forum@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)
Re: fpm_children_bury() problem
January 09, 2010 06:42PM
<value name="max_requests">102400</value>
<value name="max_children">5</value>
thanks
Re: fpm_children_bury() problem
January 09, 2010 06:52PM
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.

On Sat, Jan 9, 2010 at 3:42 PM, lnxa <nginx-forum@nginx.us> wrote:
> 102400
> 5
> thanks
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,39076,39261#msg-39261
>
>
Re: fpm_children_bury() problem
January 09, 2010 07:27PM
my vps server is 128 ram only!
mike! max_requests, max_children how to set?
Re: fpm_children_bury() problem
January 09, 2010 07:30PM
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 :))



On Sat, Jan 9, 2010 at 4:27 PM, lnxa <nginx-forum@nginx.us> wrote:
> 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
>
>
Re: fpm_children_bury() problem
January 09, 2010 08:09PM
[code]
<?xml version="1.0" ?>
<configuration>

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

<section name="global_options">

Pid file
<value name="pid_file">/var/run/php-fpm.pid</value>

Error log file
<value name="error_log">/var/log/php-fpm.log</value>

Log level
<value name="log_level">notice</value>

When this amount of php processes exited with SIGSEGV or SIGBUS ...
<value name="emergency_restart_threshold">10</value>

... 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.
<value name="emergency_restart_interval">1m</value>

Time limit on waiting child's reaction on signals from master
<value name="process_control_timeout">5s</value>

Set to 'no' to debug fpm
<value name="daemonize">yes</value>

</section>

<workers>

<section name="pool">

Name of pool. Used in logs and stats.
<value name="name">default</value>

Address to accept fastcgi requests on.
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
<value name="listen_address">127.0.0.1:9000</value>

<value name="listen_options">

Set listen(2) backlog
<value name="backlog">-1</value>

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.
<value name="owner"></value>
<value name="group"></value>
<value name="mode">0666</value>
</value>

Additional php.ini defines, specific to this pool of workers.
<value name="php_defines">
<value name="sendmail_path">/usr/sbin/sendmail -t -i</value>
<value name="display_errors">1</value>
</value>

Unix user of processes
<value name="user">nobody</value>

Unix group of processes
<value name="group">nobody</value>

Process manager settings
<value name="pm">

Sets style of controling worker process count.
Valid values are 'static' and 'apache-like'
<value name="style">static</value>

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.
<value name="max_children">5</value>

Settings group for 'apache-like' pm style
<value name="apache_like">

Sets the number of server processes created on startup.
Used only when 'apache-like' pm_style is selected
<value name="StartServers">20</value>

Sets the desired minimum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MinSpareServers">5</value>

Sets the desired maximum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MaxSpareServers">35</value>

</value>

</value>

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'
<value name="request_terminate_timeout">0s</value>

The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
<value name="request_slowlog_timeout">0s</value>

The log file for slow requests
<value name="slowlog">logs/slow.log</value>

Set open file desc rlimit
<value name="rlimit_files">65535</value>

Set max core size rlimit
<value name="rlimit_core">0</value>

Chroot to this directory at the start, absolute path
<value name="chroot"></value>

Chdir to this directory at the start, absolute path
<value name="chdir"></value>

Redirect workers' stdout and stderr into main error log.
If not set, they will be redirected to /dev/null, according to FastCGI specs
<value name="catch_workers_output">yes</value>

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
<value name="max_requests">102400</value>

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.
<value name="allowed_clients">127.0.0.1</value>

Pass environment variables like LD_LIBRARY_PATH
All $VARIABLEs are taken from current environment
<value name="environment">
<value name="HOSTNAME">$HOSTNAME</value>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
<value name="TMP">/tmp</value>
<value name="TMPDIR">/tmp</value>
<value name="TEMP">/tmp</value>
<value name="OSTYPE">$OSTYPE</value>
<value name="MACHTYPE">$MACHTYPE</value>
<value name="MALLOC_CHECK_">2</value>
</value>

</section>

</workers>

</configuration>

[/code]
Re: fpm_children_bury() problem
January 09, 2010 08:34PM
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

On Jan 9, 2010, at 5:09 PM, "lnxa" <nginx-forum@nginx.us> wrote:

>
> <?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
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready