threads and memory

Lee Leahu lee at ricis.com
Mon Feb 6 15:23:32 EST 2006


Hi List,

> > I am running into a problem where asyncore is through a filedescriptor
> > error if I try to launch more that 1023 connections:
> > ------------------------------------
> > Traceback (most recent call last):
> >   File "./test.py", line 46, in ?
> >     asyncore.loop()
> >   File "/usr/lib/python2.4/asyncore.py", line 192, in loop
> >     poll_fun(timeout, map)
> >   File "/usr/lib/python2.4/asyncore.py", line 122, in poll
> >     r, w, e = select.select(r, w, e, timeout)
> > ValueError: filedescriptor out of range in select()
> > ------------------------------------
> >
> > Is there a limitation on the number of simultaneous connects that can
> > be made with asyncore ?
> 
> what does "ulimit -n" (max number of file descriptors) say on your machine?


As a normal user, I was limited to 1024.  But su'ing to root allows me to set this higher, like 8196.

This error occurs after setting it higher (which resolves the socket.err(24, "too many open files") problem).


> if you get a larger value, you can try passing use_poll=True to the
> asyncore.loop function.

I will give this a try.


> if use_poll doesn't work, you may have to rebuild Python's select
> module to support more handles.  see the comments at the top of
> Modules/selectmodule.c for details.

Thanks!

-- 
Lee Leahu                           RICIS, Inc.
Internet Technology Specialist      866-RICIS-77 Toll Free Voice (US)
lee at ricis.com                       708-444-2690 Voice (International)
http://www.ricis.com/               866-99-RICIS Toll Free Fax (US)
                                    708-444-2697 Fax (International)

RICIS, Inc. is a member of the Public Safety Alliance Group

This email and any attachments that are included in it have been scanned
for malicious or inappropriate content and are believed to be safe.





More information about the Python-list mailing list