[Twisted-Python] Throttling outgoing client requests

Bob Ippolito bob at redivi.com
Mon Sep 12 13:05:53 EDT 2005


On Sep 12, 2005, at 9:30 AM, David E. Konerding wrote:

> I am writing a client usign Twisted that makes a lot of XMLRPC  
> requests simultaneously (using twisted.web.xmlrpc.Proxy).  There  
> are a bunch of them, all to the same site,
> and when I run on MacOSX, I start getting bind errors-- I think OS  
> X must have more restricted outgoing network connections that the  
> linux
> box I normally work on.

By default the Mac OS X descriptors limit is 256, you can change it  
though.. run "ulimit -n unlimited" (or "limit descriptors unlimited"  
in tcsh) from a shell, or you can also do something like this:

import resource
_, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (hard_limit, hard_limit))

-bob






More information about the Twisted-Python mailing list