Php-fpm Bad file descriptor errors

PHPphp-fpmphp.iniphp5

I'm using php-fpm with customer separate pools.

Sometimes page are freezing, then showing 500 internal server error, and I'm getting such errors in error log:

[11-Feb-2013 22:12:39] ERROR: unable to read what child say: Bad file descriptor (9)
[11-Feb-2013 22:12:39] ERROR: unable to read what child say: Bad file descriptor (9)
[11-Feb-2013 22:12:42] WARNING: [pool oferty] child 31186 exited on signal 11 (SIGSEGV) after 198.250454 seconds from start

My current settings are:

    [admin]
listen = 127.0.0.1:51006
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
user = admin
group = admin
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 1000
;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
request_terminate_timeout = 180s
request_slowlog_timeout = 180s
slowlog = /var/log/php-fpm/slow.log
rlimit_files = 1024
rlimit_core = 0
;chroot =
;chdir = /var/www
catch_workers_output = yes
security.limit_extensions = .php .php3 .php4 .php5

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f webmaster@domain.com
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/error.log
php_admin_value[session.save_path] = /var/lib/php/session
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 128M

What should be increased ? My server is using Intel Core i7 2600 3.4 GHz (8 threads) + 32 GB RAM, 2xSSD 120 GB Software RAID1 + 2x HDD 3 TB Software RAID

Best Answer

Increased:

pm.max_children = 20
pm.min_spare_servers = 2
pm.max_spare_servers = 4
request_terminate_timeout = 300s
request_slowlog_timeout = 300s

and all problems are gone ;)