sockets - Too Many Files Open error in java NIO -
Hi, I have created a socket and client program using Java NIO. My server and client are on different computers, the server has Linux OS and the client has Windows OS. Whenever I have created 1024 sockets on the client, but my client supports machines, but I get many files open error How to open 15,000 sockets without any error in the server. Or is there any other way to connect with 15,000 customers at the same time?
Thanks bapi
OK, inquiries why it needs 15K sockets There is a separate discussion
The answer is that you are killing user's file descriptor limit.
Log in with the user, you will use in the listener and $ ulimit -n to see the current limit. / P>
Most likely 1024
Edit the file using the root /etc/security/limits.conf
and set -> />
65536 is just a suggestion, you have to find out from your app.
Log off, log in again and check back with Voicemail N, to see if this work has been done.
You probably will need more than 15 FDA to monitor your app with LSOF.
Like this:
$ lsof -p {pid} & lt; - All file descriptor lists $ lsof -p {pid}. Wc -l & lt; By the way, you can also influence the system's wide FD range, so you have to check it out:
$ Cat / proc / Sys / fs / file-max To increase that one, add this line to /etc/sysctl.conf
# of open FD Maximum number fs.file-max = 65535
Comments
Post a Comment