Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Dec 2003 14:35:07 -0800
From:      paul beard <paulbeard@mac.com>
To:        FreeBSD-questions <questions@Freebsd.org>
Subject:   kern.maxfiles limit exceeded: what to investigate?
Message-ID:  <EDF26C36-3405-11D8-BA03-000A95BBCCF8@mac.com>

next in thread | raw e-mail | index | archive | help
I upgraded my webserver hardware from a old Pii 233 to an AMD Athlon 
700 a few weeks back and seem to be having some teething troubles with 
it. I have hit the kern.maxfiles limits twice recently, having run for 
a couple of years without even knowing there was one.

I found 420 of these in messages: Dec 21 13:39:30 red /kernel: 
kern.maxfiles limit exceeded by uid 80, please see tuning(7). and I 
could only login on console.

I read thru tuning(7) and the best I could figure is that my best 
option was to let the system work its limits based on hardware: 
accordingly, I set maxusers in my config to 0. I didn't understand the 
rest of it and I'm not sure much of it applies, since it's not exactly 
loaded (less than 10000 hits/day).

This is what I see now. It looks like a lot of headroom, I think.

kern.maxfiles: 4040
kern.maxfilesperproc: 3636
kern.openfiles: 300

Since UID 80 would be the httpd process, I suppose looking into 
process-specific resource issues is next. I am running Apache 1.3.29.

One thing I noticed that seemed a little odd was the snmpd seemed to 
behaving strangely. I did an snmpwalk to see if I could monitor these 
kernel values that way (there is so much useful stuff exposed thru 
snmp), but I found that I couldn't run it more than once, and that 
snmpd was running at 97% or so of CPU. I have deinstalled and rebuilt 
it, and now it seems to be behaving properly, but I wonder if every 5 
minute snmp requests, in and outbound, with a flaky binary were slowly 
eating up file descriptors.



--
Paul Beard
<www.paulbeard.org/>
paulbeard [at] mac.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EDF26C36-3405-11D8-BA03-000A95BBCCF8>