Too many pipes open in php-fpm

Configuring php-fpm I had a problem – even when configured in php-fpm.conf

<value name="max_children">150</value>

I got only about 120 childrens.  I found that the problem was krenel maximum open files limit. You can check it with

ulimit -a
core file size (blocks)     unlimited
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
open files                  256
pipe size (512 bytes)       10
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          29995
virtual memory (kbytes)     unlimited

These values can be globally changed in

/etc/system

. In this case reboot is needed, but for me it was easier  to add

ulimit -n 1024 

at the top

sbin/php-fpm

startup script.

Leave a Reply

Your email address will not be published. Required fields are marked *