Kern.maxfiles

I do run servers for a living, currently manage about 75 boxes. Mainly Solaris though, not FreeBSD :(

You can see what your current maxfiles is using [cmd=]sysctl kern.maxfiles[/cmd]. Keep an eye on [cmd=]sysctl kern.openfiles[/cmd], if it regularly goes up, you may need to increase your maxfiles. Or you'll get kernel errors in your log ;)
 
SirDice said:
@FBSDin20Steps and rbizzell33, kern.maxfiles can only be set before the kernel starts. Hence it must be set in /boot/loader.conf.

Where is it documented? I'm asking because changing kern.maxfiles after boot seems to work:
Code:
# sysctl kern.maxfiles
kern.maxfiles: 8008
# sysctl kern.maxfiles=25000
kern.maxfiles: 8008 -> 25000
# sysctl kern.maxfiles
kern.maxfiles: 25000
 
Code:
     The kern.maxfiles sysctl determines how many open files the system sup‐
     ports.  The default is typically a few thousand but you may need to bump
     this up to ten or twenty thousand if you are running databases or large
     descriptor‐heavy daemons.  The read‐only kern.openfiles sysctl may be
     interrogated to determine the current number of open files on the system.

Can't find anything about kern.maxfiles being READ-ONLY anywhere in that manpage.
 
My overall performance went a bit slower and applications became less responsive after applying "kern.maxfiles" to /boot/loader.conf. Guys aren't we mixing "kern.maxfiles" with "kern.maxusers"?
 
crsd said:
Can't find anything about kern.maxfiles being READ-ONLY anywhere in that manpage.

It isn't. It seems I mixed up maxusers and maxfiles. Maxusers can only be set during boot and cannot be changed on a running system.

Blame it on my AD/HD induced dyslexia :\
 
Back
Top