java.net.SocketException: Too many open files

Gabriel Ambuehl gabriel_ambuehl at buz.ch
Thu Mar 18 01:38:49 PST 2004


Hello Panagiotis,

Thursday, March 18, 2004, 10:12:38 AM, you wrote:

> Nick Gieczewski wrote:

>> I have written a small program that attempts to open 2,048 concurrent
>> connections to the server in oder to reproduce this. On my FreeBSD
>> box, the thread dies with the above exception at 500-600 open
>> connections. When running the server application on Win32, on the
>> other hand, I'm able to open all the 2,048 connections without a
>> hitch.

> Hello,

> would you mind posting your small test program? It would help shed some
> light I think.

Maybe system resource limits are too low (IIRC, 4-STABLE has hard
wired, relatively low limits)? Seems like the 2048 on Win
are some arbitrary limit as well (didn't someone benchmark a tuned
4-STABLE with some 1,6 MILLION concurrent connections to a dummy server?
So one would guess more than 2K connections should be possible when
the system is configured properly). I think the default hoovers
somewhere around 1024 file descriptors, so 500 to 600 is reasonable
considering that the system and daemons will chew up a few of their
own.


My CURRENT box says:

#sysctl -a | grep files

kern.maxfiles: 7560
kern.maxfilesperproc: 6804


Best regards,
 Gabriel



More information about the freebsd-java mailing list