Hi,
So, upgrading one of my webservers to -current (snapshot with kernel
build #2498: Tue Sep 27 17:53:43 MDT 2016), my httpd suddenly failed
to start. rcctl -d start httpd showed it's about hitting the open
file limit, and trying to check the config confirmed that problem:
[root@agony] # httpd -n
httpd: proc_open: Too many open files
After a bit of ktracing, I discovered an enormous amount of
socketpairs being created:
[root@agony] # kdump | grep -c socketpair
126
These are the last four socketpair occurences in the kdump output:
24897 httpd CALL
socketpair(AF_LOCAL,0xc001<SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK>,0,0x7f7fffffa4d8)
24897 httpd RET socketpair 0
24897 httpd CALL
socketpair(AF_LOCAL,0xc001<SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK>,0,0x7f7fffffa4d8)
24897 httpd RET socketpair -1 errno 24 Too many open files
I played around with the prefork setting, as that might be related.
My config had this set to 10 originally. Turns out, httpd would start
with prefork 6, and fail with prefork 7. Further testing showed that,
once started with prefork 6, the daemon would exit immediately with
the same error message:
Sep 28 14:38:18 agony httpd[17457]: startup
Sep 28 14:38:18 agony httpd[17457]: parent: send server: Too many open files
Sep 28 14:38:18 agony httpd[72640]: logger exiting, pid 72640
Sep 28 14:38:18 agony httpd[37590]: server exiting, pid 37590
Sep 28 14:38:18 agony httpd[15875]: server exiting, pid 15875
Sep 28 14:38:18 agony httpd[63956]: server exiting, pid 63956
Sep 28 14:38:18 agony httpd[52969]: server exiting, pid 52969
Sep 28 14:38:18 agony httpd[31747]: server exiting, pid 31747
Sep 28 14:38:18 agony httpd[30887]: server exiting, pid 30887
So, I'm now running with 'prefork 5', which gives me a working setup.
I've reproduced this on my laptop (which runs a slightly older
snapshot) with the following minimal config:
[weerd@drop] $ cat /etc/httpd.conf
prefork 7
server "default" {
listen on * port 80
}
This config will fail to pass the config checker:
[weerd@drop] $ doas httpd -n
httpd: proc_open: Too many open files
Lowering prefork to 6 allows it to pass.
Cheers,
Paul 'WEiRD' de Weerd
--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
http://www.weirdnet.nl/