Sun Webserver 7 TP3 + FCGI leaking file descriptors (?)
Hi.
We are using Sun Webserver (Technology Preview 3 of version 7) to run a perl script as a FastCGI application. Snippets from configuration files:
magnus.conf:
Init fn="load-modules" shlib="libj2eeplugin.so" shlib_flags="(global|now)"
Init fn="load-modules" shlib="/opt/webserver7/plugins/fastcgi/libfastcgi.so" shlib_flags="(global|now)"
obj.conf:
NameTrans fn="assign-name" from="/ips/checkmail.fcgi" name="fcgi.config"
...
<Object name="fcgi.config">
Service fn="responder-fastcgi" app-path="/www/icq/ips/checkmail.fcgi" min-procs=15 max-procs=35 req-retry=3
</Object>
Our problem is, that after some time, the webserver starts returning HTTP 500 errors for all requests for this file, instead of sending the output of the app and a HTTP 200 results. At the same time, the following message is in the error log file, for each requests:
[18/Mar/2007:12:53:36] failure (15328): HTTP3069: Error accepting connection (PR_PROC_DESC_TABLE_FULL_ERROR: file descriptor table full)
One of the webserver's processes has a lot of open files like this (from pfiles):
11573: S_IFSOCK mode:0666 dev:276,0 ino:19498 uid:0 gid:0 size:0
O_RDWR|O_NONBLOCK
SOCK_STREAM
SO_SNDBUF(16384),SO_RCVBUF(5120)
sockname: AF_UNIX
peername: AF_UNIX /tmp/https-www-script-1-5351d5c9/Fastcgistub_23270
I set "ulimit -n" to 65000, but it's only a matter of time, I'm afraid, until it uses all of them.
Killing this one process solves the issue temporarily. Until it uses up all available FDs again.
Even though the maximum of fcgi processes is set to 35, only 15 are present. I.e. the 15 are enough to fulfill all requests.
With "ulimit -n" set to "unlimited", after server start, I get multiple Fastcgistub processes instead of just one and no fcgi processes get started.
To keep the server running correctly, I need to monitor it constantly and kill the offending process, when it uses up all FDs. This is not good, obviously.
Is there a solution for this problem? Is it a bug? Or just a mis-configuration?

