Re: Too many files open
Re: Too many files open
- Subject: Re: Too many files open
- From: Justin Walker <email@hidden>
- Date: Wed, 2 Jun 2004 01:37:58 -0700
On Jun 2, 2004, at 1:08, Eric Arlotti wrote:
Hello,
My application is a Web server based on 4th Dimension. It uses a
third-party library to manage TCP connections.
In some cases, when many listening sockets are created, we get a -42
error (too many files open) on file manager calls. I suppose that this
means that we have reached the maximum number of files or sockets that
the system can handle but I don't really know how I can tune Mac OS X
kernel to handle more.
The first thing to do is to assure that the app isn't "leaking"
descriptors. You can see what files/sockets are open using 'lsof' (as
root, unless you own the processes in question).
First, I have tried to use the sysctl command and increase
kern.maxfiles and kern.maxfilesperproc but nothing changed (with or
without rebooting). I have also tried to change kern.ipc.maxsockets
but I get a "oid 'kern.ipc.maxsockets' is read only" message.
What does "nothing changed" mean? Also, on 10.3.x, I don't see
'kern.maxfiles'.
I looked for information about FreeBSD kernel. I have found something
about a file named "loader.conf" (/boot/loader.conf) that would
contain system configuration but I couldn't find it in Mac OS X
system.
FreeBSD != Darwin/Mac OS X; in particular, the kernel is not
"configurable" in the same way the FreeBSD kernel is.
I suppose that there are others system variables to tune but I don't
know them. And I also don't know how to make these changes permanent
after a system reboot.
The only way to make 'sysctl' changes permanent is to include them in a
system startup script (e.g.,
/System/Library/StartupItems/SystemTuning/SystemTuning).
Also, you should check the Apple developer website
(<
http://developer.apple.com>) for documentation; and this (and other,
darwin-related) list archives.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | Some people have a mental
| horizon of radius zero, and
| call it their point of view.
| -- David Hilbert
*--------------------------------------*-------------------------------*
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.