Click here to get back home

The select() (IO::Select) function has a limit?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
The select() (IO::Select) function has a limit? peste 06-02-2008
Posted by peste on June 2, 2008, 5:24 am
Please log in for more thread options
Hi list,
i'm writing a daemon in perl for exchanging data from a big quantity
of machines (over 100000) over the network and I use the select()
function in order to select the correct file handler (to read or
write).

All is fine when the number of clients is <100, but when arrives the
101th client the connection with this is dropped.

Is this a limit of the IO::Select?

Thanks,
M.Canato

Posted by xhoster on June 2, 2008, 1:03 pm
Please log in for more thread options
> Hi list,
> i'm writing a daemon in perl for exchanging data from a big quantity
> of machines (over 100000) over the network and I use the select()
> function in order to select the correct file handler (to read or
> write).
>
> All is fine when the number of clients is <100, but when arrives the
> 101th client the connection with this is dropped.

What do you mean "dropped"? What return value or error message are you
getting from what piece of code?

> Is this a limit of the IO::Select?

Not inherently. Maybe it is limit of the underlying structures which
IO::Select must interact with on some OSes. On Unix I have no problem
getting more than 300 socket connections. On Windows I can only get 80.

Can you dummy up some kind of short simple program that replicates
the problem (with a dummy driver to take the other end of the connections)
that you can post here so we can play with it?


Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Posted by Ted Zlatanov on June 2, 2008, 3:58 pm
Please log in for more thread options

p> i'm writing a daemon in perl for exchanging data from a big quantity
p> of machines (over 100000) over the network and I use the select()
p> function in order to select the correct file handler (to read or
p> write).

p> All is fine when the number of clients is <100, but when arrives the
p> 101th client the connection with this is dropped.

p> Is this a limit of the IO::Select?

You'll hit a limit long before 100,000 file descriptors, and it's always
annoying to have arbitrary limits on the number of clients. Consider
using multicast messages or a distributed messaging protocol like XMPP
(http://www.xmpp.org/) if you can. It really depends on your network
topology and reliability/responsiveness requirements.

Ted

Posted by sheinrich on June 3, 2008, 5:31 pm
Please log in for more thread options
I once wrote a PreforkAgent.pm of which I was told that it ran with
500 children without a problem. (That's 1000 open pipes to maintain)

That was on a SLES. (Suse Linux Enterprise Server)

Steffen




Posted by peste on June 4, 2008, 2:44 am
Please log in for more thread options
thanks to all, i was thinking to migrate to another protocol (like
xmpp) and now i start to implement the new protocol in other
programming languages like C.

Thanks again.
M.Canato

Similar ThreadsPosted
IO::Select::select() says no readable data even if there are August 24, 2006, 2:53 am
Select October 10, 2006, 4:40 pm
Help with select December 18, 2006, 8:13 am
IO::Select extension January 22, 2005, 1:51 am
How to select subroutine June 20, 2006, 6:32 pm
Using DBI, Set Select to Variable August 27, 2007, 12:35 am
select number September 10, 2007, 11:49 am
select and filehandle June 5, 2008, 3:08 pm
Re: select and filehandle June 5, 2008, 6:10 pm
www::mechanize $mech->select February 4, 2005, 5:28 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap