Maximum TCP Socket Connections
Is there some kind of maximum TCP connection setting in Java? I have a server
application that accepts incoming TCP socket connections. I set up a very
large pool of threads that listen for connection requests. These objects
do just fine until I exceed 640 simultaneous connections. At this point
I get an exception on "serverSocket.accept();" The error returned is "Too
many open files". I seem to have plenty of memory. I've adjusted the heap
settings to much higher values than I feel I need but nothing seems to improve
on this 640 limit.
I'm running this on Redhat Linux 7.2 with JDK 1.3.1_02.
Even if you're not sure what the problem is, please respond with any suggestions
you may have. This problem is a serious show-stopper for my project right
now.
Thanks in advance,
-Tom
Re: Maximum TCP Socket Connections
The linux kernel imposes a limit (of 1024) on the number of file
descriptors per process. Of course tcp/ip sockets also appear as files
and require file descriptors.
You need to recompile your kernel and change some environment settings.
Check out http://www.jlinux.org/server.html for a description of the
problem and how to fix it.
"Tom" <tom.heagy@sciatl.com> wrote:
>
>Is there some kind of maximum TCP connection setting in Java? I have a
server
>application that accepts incoming TCP socket connections. I set up a very
>large pool of threads that listen for connection requests. These objects
>do just fine until I exceed 640 simultaneous connections. At this point
>I get an exception on "serverSocket.accept();" The error returned is "Too
>many open files". I seem to have plenty of memory. I've adjusted the heap
>settings to much higher values than I feel I need but nothing seems to improve
>on this 640 limit.
>
>I'm running this on Redhat Linux 7.2 with JDK 1.3.1_02.
>
>Even if you're not sure what the problem is, please respond with any suggestions
>you may have. This problem is a serious show-stopper for my project right
>now.
>
>Thanks in advance,
>
>-Tom