View previous topic :: View next topic |
Author |
Message |
tyfon
Joined: 29 Apr 2004 Posts: 4
|
Posted: Thu Apr 29, 2004 12:27 pm Post subject: |
|
|
The FD limit is hardcoded in kernel. Or was. Now it might just be in libc, but anyway it is a bad idea to open that many diffrent FD's in linux.
If these requests are processed sequentially, it is much better to just use one for each connect/accept. And you allways have one for listen().
With 20 threads it should only be 40+1 FD's. It is also important to use shutdown() on the listening socket before terminating the program, or it will fail to listen() next time you run it (for a few minutes).
I'm sitting at a windows pc at work atm, and i dont have internet at home so i cant check stuff. But i have done a bit of socket programming under *bsd/linux .. just wish i had internet at home :p.. I hate moving. Grr _________________ --
Ãyvind Jægtnes |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Tue May 04, 2004 2:09 am Post subject: |
|
|
tyfon wrote: | The FD limit is hardcoded in kernel. Or was. Now it might just be in libc, but anyway it is a bad idea to open that many diffrent FD's in linux.
If these requests are processed sequentially, it is much better to just use one for each connect/accept. And you allways have one for listen().
With 20 threads it should only be 40+1 FD's. |
I'd certainly like to reuse 'em. However, socket.accept() typically creates a new FD (depending on what's available for scavanging) and in this particular case, the client test-jig is deliberately stressing the server rather than taking advantage of a "keep-alive" approach.
One would hope to avoid consuming vast quantities of sockets in the manner that this arbitrary test does. Outside of the test-jig, can you point out how to optimize this kind of thing? If you'd like to modify mango.server appropriately, that would be great!
- Kris |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|