Welcome! Log In Create A New Profile

Advanced

рабочие процессы php-fpm 5.3 сегфолтятся

Posted by Sb0y 
рабочие процессы php-fpm 5.3 сегфолтятся
March 16, 2010 05:36PM
Всем привет. Я взял из svn последнюю версию php+fpm (svn co http://svn.php.net/repository/php/php-src/branches/PHP_5_3_FPM php_5_3_fpm), cобрал и тут меня ждал очень не приятный сюрприз.

запуская php-fpm -y /etc/php-fpm.conf я получаю

[code]
bagrincev php_5_3_fpm # php-fpm -y /etc/php-fpm.conf
Mar 17 00:32:49.731679 [NOTICE] fpm_unix_init_main(), line 284: getrlimit(nofile): max:190535, cur:150535
Mar 17 00:32:49.732159 [NOTICE] fpm_event_init_main(), line 88: libevent: using epoll
Mar 17 00:32:49.732514 [NOTICE] fpm_init(), line 50: fpm is running, pid 24009
Mar 17 00:32:49.734244 [NOTICE] fpm_children_make(), line 354: child 24011 (pool default) started
Mar 17 00:32:49.736018 [NOTICE] fpm_children_make(), line 354: child 24012 (pool default) started
Mar 17 00:32:49.737780 [NOTICE] fpm_children_make(), line 354: child 24013 (pool default) started
Mar 17 00:32:49.739576 [NOTICE] fpm_children_make(), line 354: child 24014 (pool default) started
Mar 17 00:32:49.741338 [NOTICE] fpm_children_make(), line 354: child 24015 (pool default) started
Mar 17 00:32:49.743153 [NOTICE] fpm_children_make(), line 354: child 24016 (pool default) started
Mar 17 00:32:49.744928 [NOTICE] fpm_children_make(), line 354: child 24017 (pool default) started
Mar 17 00:32:49.746782 [NOTICE] fpm_children_make(), line 354: child 24018 (pool default) started
Mar 17 00:32:49.748726 [NOTICE] fpm_children_make(), line 354: child 24019 (pool default) started
Mar 17 00:32:49.750528 [NOTICE] fpm_children_make(), line 354: child 24020 (pool default) started
Mar 17 00:32:49.752434 [NOTICE] fpm_children_make(), line 354: child 24021 (pool default) started
Mar 17 00:32:49.754245 [NOTICE] fpm_children_make(), line 354: child 24022 (pool default) started
Mar 17 00:32:49.756105 [NOTICE] fpm_children_make(), line 354: child 24023 (pool default) started
Mar 17 00:32:49.758420 [NOTICE] fpm_children_make(), line 354: child 24024 (pool default) started
Mar 17 00:32:49.760188 [NOTICE] fpm_children_make(), line 354: child 24025 (pool default) started
Mar 17 00:32:49.762050 [NOTICE] fpm_children_make(), line 354: child 24026 (pool default) started
Mar 17 00:32:49.763925 [NOTICE] fpm_children_make(), line 354: child 24027 (pool default) started
Mar 17 00:32:49.765767 [NOTICE] fpm_children_make(), line 354: child 24028 (pool default) started
Mar 17 00:32:49.767671 [NOTICE] fpm_children_make(), line 354: child 24029 (pool default) started
Mar 17 00:32:49.769538 [NOTICE] fpm_children_make(), line 354: child 24030 (pool default) started
Mar 17 00:32:49.771441 [NOTICE] fpm_children_make(), line 354: child 24031 (pool default) started
Mar 17 00:32:49.773334 [NOTICE] fpm_children_make(), line 354: child 24032 (pool default) started
Mar 17 00:32:49.775768 [NOTICE] fpm_children_make(), line 354: child 24033 (pool default) started
Mar 17 00:32:49.777889 [NOTICE] fpm_children_make(), line 354: child 24034 (pool default) started
Mar 17 00:32:49.779851 [NOTICE] fpm_children_make(), line 354: child 24035 (pool default) started
Mar 17 00:32:49.781739 [NOTICE] fpm_children_make(), line 354: child 24036 (pool default) started
Mar 17 00:32:49.783647 [NOTICE] fpm_children_make(), line 354: child 24037 (pool default) started
Mar 17 00:32:49.785563 [NOTICE] fpm_children_make(), line 354: child 24038 (pool default) started
Mar 17 00:32:49.787494 [NOTICE] fpm_children_make(), line 354: child 24039 (pool default) started
Mar 17 00:32:49.789416 [NOTICE] fpm_children_make(), line 354: child 24040 (pool default) started
Mar 17 00:32:49.791369 [NOTICE] fpm_children_make(), line 354: child 24041 (pool default) started
Mar 17 00:32:49.793301 [NOTICE] fpm_children_make(), line 354: child 24042 (pool default) started
Mar 17 00:32:49.795252 [NOTICE] fpm_children_make(), line 354: child 24043 (pool default) started
Mar 17 00:32:49.797192 [NOTICE] fpm_children_make(), line 354: child 24044 (pool default) started
Mar 17 00:32:49.799161 [NOTICE] fpm_children_make(), line 354: child 24045 (pool default) started
Mar 17 00:32:49.802606 [NOTICE] fpm_children_make(), line 354: child 24046 (pool default) started
Mar 17 00:32:49.804668 [NOTICE] fpm_children_make(), line 354: child 24047 (pool default) started
Mar 17 00:32:49.807637 [NOTICE] fpm_children_make(), line 354: child 24048 (pool default) started
Mar 17 00:32:49.809665 [NOTICE] fpm_children_make(), line 354: child 24049 (pool default) started
Mar 17 00:32:49.811642 [NOTICE] fpm_children_make(), line 354: child 24050 (pool default) started
Mar 17 00:32:49.815180 [NOTICE] fpm_children_make(), line 354: child 24051 (pool default) started
Mar 17 00:32:49.817181 [NOTICE] fpm_children_make(), line 354: child 24052 (pool default) started
Mar 17 00:32:49.819214 [NOTICE] fpm_children_make(), line 354: child 24053 (pool default) started
Mar 17 00:32:49.821132 [NOTICE] fpm_children_make(), line 354: child 24054 (pool default) started
Mar 17 00:32:49.823185 [NOTICE] fpm_children_make(), line 354: child 24055 (pool default) started
Mar 17 00:32:49.825180 [NOTICE] fpm_children_make(), line 354: child 24056 (pool default) started
Mar 17 00:32:49.827449 [NOTICE] fpm_children_make(), line 354: child 24057 (pool default) started
Mar 17 00:32:49.829692 [NOTICE] fpm_children_make(), line 354: child 24058 (pool default) started
Mar 17 00:32:49.831764 [NOTICE] fpm_children_make(), line 354: child 24059 (pool default) started
Mar 17 00:32:49.833787 [NOTICE] fpm_children_make(), line 354: child 24060 (pool default) started
Mar 17 00:32:49.833974 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop
Mar 17 00:32:52.367433 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Mar 17 00:32:52.367656 [WARNING] fpm_children_bury(), line 217: child 24011 (pool default) exited on signal 11 SIGSEGV after 2.633430 seconds from start
Mar 17 00:32:52.369706 [NOTICE] fpm_children_make(), line 354: child 24061 (pool default) started
Mar 17 00:32:55.736940 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Mar 17 00:32:55.737127 [WARNING] fpm_children_bury(), line 217: child 24012 (pool default) exited on signal 11 SIGSEGV after 6.001126 seconds from start
Mar 17 00:32:55.739390 [NOTICE] fpm_children_make(), line 354: child 24062 (pool default) started
Mar 17 00:33:06.769878 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Mar 17 00:33:06.770070 [WARNING] fpm_children_bury(), line 217: child 24013 (pool default) exited on signal 11 SIGSEGV after 17.032307 seconds from start
Mar 17 00:33:06.772421 [NOTICE] fpm_children_make(), line 354: child 24063 (pool default) started
^CMar 17 00:33:09.134560 [NOTICE] fpm_got_signal(), line 52: received SIGINT
Mar 17 00:33:09.134650 [NOTICE] fpm_pctl(), line 256: switching to 'terminating' state
Mar 17 00:33:09.134718 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24063 (pool default)
Mar 17 00:33:09.134775 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24062 (pool default)
Mar 17 00:33:09.134824 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24061 (pool default)
Mar 17 00:33:09.134932 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24060 (pool default)
Mar 17 00:33:09.135070 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24059 (pool default)
Mar 17 00:33:09.135125 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24058 (pool default)
Mar 17 00:33:09.135215 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24057 (pool default)
Mar 17 00:33:09.135282 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24056 (pool default)
Mar 17 00:33:09.135338 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24055 (pool default)
Mar 17 00:33:09.135387 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24054 (pool default)
Mar 17 00:33:09.135436 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24053 (pool default)
Mar 17 00:33:09.135485 [NOTICE] fpm_pctl_kill_all(), line 172: sending signal 15 SIGTERM to child 24052 (pool default)

....
[/code]


И так до бесконечности. Результат работы с таким логом - 502 Bad Gateway.
Мой php-fpm.conf

[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/lib/run/php-fpm.pid</value>

Error log file
<value name="error_log">/var/lib/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">no</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">/tmp/nginx/fastcgi</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">ftp</value>
<value name="group">ftp</value>
<value name="mode">0666</value>
</value>

Additional php.ini defines, specific to this pool of workers.
These settings overwrite the values previously defined in the php.ini.
<value name="php_defines">
<!-- <value name="sendmail_path">/usr/sbin/sendmail -t -i</value> -->
<!-- <value name="display_errors">0</value> -->
<!-- <value name="error_log">/var/log/php-error.log</value> -->
<!-- <value name="log_errors">true</value> -->
</value>

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

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

Process manager settings
<value name="pm">

Sets style of controling worker process count.
Valid values are 'static' and 'dynamic'
<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">50</value>

Sets the status URI to call to obtain php-fpm status page.
If not set, no URI will be recognized as a status page.
By default, it returns text/plain looking like:
accepted conn: 12073
pool: default
process manager: static
idle processes: 35
active processes: 65
total processes: 100
"accepted conn" : the number of request accepted by the pool
"pool" : the name of the pool
"process manager": static or dynamic
"idle processes": the number of idle processes
"active processes": the number of active processes
"total processes": idle + active
The last three number are uptaded every second.
The "accepted conn" is updated in real time
*** Output ***
By default it returns text/plain
But passing as a query string html or json, it will returns
the corresponding output syntax:
http://www.foo.bar/status
http://www.foo.bar/status?json
http://www.foo.bar/status?html
*** WARNING ***
It has to start with a /. It could be named has you want.
It's maybe not a good idea to use .php extension to be certain
not to conflict with a real PHP file
<!--<value name="status">/status</value>-->

Set the ping URI to call the monitoring page of php-fpm
If not set, no URI will be recognized as a ping page.
This could be used to test from outside that php-fpm
is alive and responding:
- have a graph of php-fpm availability (rrd or such)
- remove a server from a pool if it's not responding (load balancing systems)
- trigger alerts for the operating team (24/7)
*** WARNING ***
It has to start with a /. It could be named has you want.
It's maybe not a good idea to use .php extension to be certain
not to conflict with a real PHP file
<!--<value name="ping">/ping</value>-->
Set the response to custom the response of a ping request
If 'pong' is not set, the default is "pong".
The response is text/plain with a 200 response code
<!--<value name="pong">pong</value>-->

Settings group for 'dynamic' pm style
<!--
<value name="dynamic">

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

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

Sets the desired maximum number of idle server processes.
Used only when 'dynamic' pm_style is selected
<value name="max_spare_servers">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">/var/lib/log/php-fpm.log.slow</value>

Set open file desc rlimit
<value name="rlimit_files">1024</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">0</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]

php-fpm -m:

[code]
[PHP Modules]
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
json
libxml
mbstring
mcrypt
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
posix
pspell
Reflection
session
SimpleXML
snmp
soap
sockets
SPL
SQLite
standard
suhosin
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaz
zip
zlib

[Zend Modules]
Suhosin
[/code]

Собирал с такими флагами:

[code]
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr/lib/php5 --mandir=/usr/lib/php5/man --infodir=/usr/lib/php5/info --libdir=/usr/lib/php5/lib --with-pear --enable-maintainer-zts --enable-bcmath=shared --with-bz2=shared --enable-calendar=shared --with-curl=shared --with-curlwrappers --without-enchant --enable-exif=shared --enable-ftp=shared --with-gettext=shared --with-gmp=shared --disable-intl --without-kerberos --enable-mbstring=shared --with-mcrypt=shared --without-mssql --with-onig=/usr --with-openssl --with-openssl-dir=/usr --enable-pcntl=shared --disable-phar --without-pgsql --with-pspell=shared --without-recode --disable-shmop --with-snmp=shared --enable-soap=shared --enable-sockets=shared --without-sqlite3 --without-sybase-ct --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --with-tidy=shared --enable-wddx=shared --with-xmlrpc=shared --with-xsl=shared --enable-zip=shared --with-zlib=shared --disable-debug --enable-dba=shared --with-cdb --with-db4 --enable-flatfile --with-gdbm --enable-inifile --without-qdbm --with-freetype-dir=/usr --with-t1lib=/usr --disable-gd-jis-conv --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-gd --with-imap=shared --with-imap-ssl --without-interbase --without-interbase --with-mysql=shared,/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-mysqli=shared,/usr/bin/mysql_config --with-unixODBC=shared,/usr --without-adabas --without-birdstep --without-dbmaker --without-empress --without-esoob --without-ibm-db2 --without-iodbc --without-sapdb --without-solid --without-oci8 --without-pdo-dblib --with-pdo-mysql=shared,/usr --without-pdo-pgsql --with-pdo-sqlite=shared,/usr --with-pdo-odbc=shared,unixODBC,/usr --with-readline --without-libedit --without-mm --with-sqlite=/usr --enable-sqlite-utf8 --with-pic --with-pcre-regex=/usr --with-pcre-dir=/usr --enable-cli --disable-cgi --disable-embed --without-apxs2 --with-config-file-path=/etc/php/cli-php5 --with-config-file-scan-dir=/etc/php/cli-php5/ext-active --enable-fpm
[/code]

Что это может быть?



Edited 2 time(s). Last edit at 03/16/2010 05:42PM by Sb0y.
Re: рабочие процессы php-fpm 5.3 сегфолтятся
March 16, 2010 09:06PM
Разобрался. Дело было в suhosin. Ещё выкинул многое из configure.
php-fpm -m:

[code]
[PHP Modules]
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
json
libxml
mbstring
mcrypt
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
posix
pspell
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaz
zip
zlib

[Zend Modules]

[/code]
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready