Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Event::Lib 1024 socket limit

by Ray Smith (Beadle)
on Sep 12, 2007 at 21:41 UTC ( [id://638692]=perlquestion: print w/replies, xml ) Need Help??

Ray Smith has asked for the wisdom of the Perl Monks concerning the following question:

Event::Lib appears to provide an efficient mechanism to handle thousands of open sockets. When I converted my code to make use of it and tried to compare the new version with my previous structure based on IO:Select, I found that Event::Lib appears to be limited to 1024 open sockets. Does anyone know how to exceed this limit? I looked at the eventlib(libevent-1.3d) code on which Event::Lib is based and it was not clear how or if one could modify it.
Thanks for you attention.

Replies are listed 'Best First'.
Re: Event::Lib 1024 socket limit
by Fletch (Bishop) on Sep 12, 2007 at 23:13 UTC

    Sounds like you've hit an OS soft or hard limit. Check with your sysadmin and/or consult your shell's documentation for its ulimit command.

      You are correct that there is a limit of 1024 sockets when not running as root. However, as root, we often extend the maximum to 8K. In our IO::Select based implementation we have gone to 2K open sockets. But at these numbers the CPU load is considerable. I'm hoping there is someone out there who has found a way to get Event::Lib past the 1024 limit. I was thinking this might be by recompiling libevent. I was hoping that there might be a switch or something I might correct to get past this limit.
Re: Event::Lib 1024 socket limit
by jbert (Priest) on Sep 13, 2007 at 14:19 UTC
    You might also want to look at Danga::Socket. I think it uses an epoll interface which should be optimal on Linux (maybe Event::Lib uses the same interface, not sure).

    Djabberd (which I think is built on Danga::Socket) has scaled to more than 1k sockets, anyway: http://brad.livejournal.com/2230083.html.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://638692]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2026-01-13 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.