tags:

views:

583

answers:

2

Hi I have created a socket and client program using java NIO. My server and client are on different computers ,Server have LINUX OS and CLIENT have WINDOWS OS. Whenever I have created 1024 sockets on client my client machines supports but in server I got too many files open error. So How to open 15000 sockets without any error in server. Or is there any other way to connect with 15000 clients at the same time?

Thanks Bapi

+2  A: 

Why do you need to have 15000 sockets on one machine? Anyway, look at ulimit -n

Matthew Flaschen
Thanks Matthew Flaschen,ulimit -n gives me 1024. What does it mean.Also How can I connect to 15000 clients at the same time.Thanks,Bapi
Deepak
man ulimit.if you execute ulimit -n 20000 before starting the server, the process will be allowed to open more files.
KarlP
(in the same shell /start script)
KarlP
Thanks Karlp,Can you please mention what is the maximum file that can be opened in linux OS. Does it support opening 200000 file?
Deepak
If you want to find the system-wide limit, look at the special file /proc/sys/fs/file-max . You can also modify that. However, I concur you should not be modifying these limits without great reason. Building out (more machines) is better and usually cheaper than building up (trying to make a single machine do more).
Matthew Flaschen
Often your OS has a hard limit you cannot easily increase beyond. You are likely to have scalability problems if you have more than about 10K connections to one machine.
Peter Lawrey
I don't think you quite understand the scope of your problem here.
Nighthawk
A: 

If you're going to have 15,000 clients talking to your server (and possibly 200,000 in the future according to your comments) then I suspect you're going to have scalability problems servicing those clients once they're connected (if they connect).

I think you may need to step back and look at how you can architect your application and/or deployment to successfully achieve these sort of numbers.

Brian Agnew
Hi Brian,Thanks for your info. Can you please guide me in the right direction for how to create more than 15000 connections without creating that much client
Deepak
Not in the space of a comment field. I think you may have to start Googling, based on the required functionality of your application. Best of luck
Brian Agnew