How to count number of connections from nginx workers to php-cgi unix socket?

Igor Prokopenkov cmyk777 at
Mon Feb 7 21:30:30 UTC 2011

I need to count number of connections to php's cgi unix socket (created with
spawn-fci). When nginx initiates a connection to cgi socket one of spawned
php processes accepts this connection, processes input and outputs data. But
number of processes is limited and i want to be able to monitor amount of
free processes. I tried all available tools (netstat, sockstat even lsof)
but it seems there is no way to determine how many active connections from
nginx to unix socket. Please advise.

Best regards,
Igor Prokopenkov
Zend Certificied Engineer

More information about the freebsd-questions mailing list