FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Linux Linking issues
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
tyfon



Joined: 29 Apr 2004
Posts: 4

PostPosted: Thu Apr 29, 2004 12:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Tue May 04, 2004 2:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
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