Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Dec 2003 10:26:55 -0800
From:      paul beard <>
To:        FreeBSD-questions <>
Subject:   kern.maxfiles problem resolved
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
I figured this out last night but not before I had one spell of 
catatonia on my system.

I used mrtg to graph the increase in file descriptor usage and it made 
nice straight line, not a curve. That looked suspicious. I also set up 
a simple while loop in my shell to keep an eye on this. (while [ 1 ] ; 
do sysctl kern.maxfiles; sleep 60; done ). When that stopped updating 
at about 6600 files (the max is set at 16384), I rebooted (console was 

In the process of looking at this, I had noticed that there were a few 
nmbd (samba) processes in the process table: I expect to see one or 
two, but not 10 or more. I watched this after rebooting, and sure 
enough, new processes were spawning ever couple of minutes, and this 
with no logins to the samba shares.

What struck me as odd about this is that the abuse of the file table 
was being blamed on the wrong UID (80): nmbd doesn't run as the www 
user, so even if I had been more clueful about fstat, there's a good 
chance I would have been looking in the wrong places.

I killed the samba processes, deinstalled samba, refreshed from cvs 
and, noting that the version was the same (2.2.8a), I reinstalled with 
portinstall -P.

That seemed to do it. Now openfiles are sitting in the low 200s . . . .

I've posted this on my weblog with the relevant image (didn't want to 
send an attachment to the list).
Paul Beard
paulbeard [at]

Want to link to this message? Use this URL: <>