Messages in this thread | | | From | "Craig Munday" <> | Subject | Re: Opening 5000 file descriptors in linux?? | Date | Tue, 30 Mar 1999 07:29:36 +1000 |
| |
Lokesh,
I think you might find it problematic opening so many file descriptors. You should consider the activity of the client, my guess is not all clients will be active at the same time. Therefore you could have a pool of say 100 sockets (can be any number) that you share amongst the 5000 or 20000 clients. In this case each client has a type of virtual connection in the sense that the client may not actually have an open socket but it looks and acts as if it did.
Obviously when either the server or the client needs to send anything you must re-establish the socket connection.
Alternatively, you might be able to define a protocol that sends packets of data between the client and server. In this way, the socket is only open while the packet is being sent. This might get around your problem of having so many sockets open at once, but the process of opening and closing so many socket connection might be over whelming.
Hope this helps. Cheers Craig.
---------- > From: Lokesh Setia <eeu95176@cse.iitd.ernet.in> > To: linux-kernel@vger.rutgers.edu > Cc: linux-gcc@vger.rutgers.edu > Subject: Opening 5000 file descriptors in linux?? > Date: Sunday, March 28, 1999 5:10 PM > > > [ please cc: a copy of the reply to eeu95176@cse.iitd.ernet.in as i am not > a member of this mailing list ]. > > Hi, > > I am writing a program (somewhat similar to irc server) that would > simultaneously open ~5000 sockets and talk to all these clients. As far as > i know a process can open only about 50-60 sockets (file descriptors). > > Will i have to open multiple processes with some form of IPC or shared > memory, or can i configure a kernel to let a process open any amount of > file descriptors. If yes, where in the kernel code should i change. > > Can a 200MHz pentium take the load of a process with 5000 open file > descriptors, or will it just crash. Also which of the above 2 approaches > (single process or multiple process) will result in better utiliziation > and better stability. > > What if the number of sockets is 20000 instead of 5000? ;-) > > Thanx, > > Lokesh. >
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |