[Twisted-Python] Agent and "Cannot assign requested address"

Itamar Turner-Trauring itamar at itamarst.org
Fri Mar 4 08:29:31 EST 2011

On Thu, 2011-03-03 at 21:00 -0700, Jason J. W. Williams wrote:
> Hi All,
> I've got a situation where I'm using t.w.c.Agent to make 100,000 POST
> request against a server. Each time a new Agent instance is built and
> the request is sent using it. After about 20,000 requests, I get this
> error:
> Failure: twisted.internet.error.ConnectError: An error occurred while
> connecting: 99: Cannot assign requested address.
> Would building the Agent once and reusing the same instance avoid
> this? I assume I've run out of client ports.

Yes... except it doesn't support persistent connections yet. Do you
actually need to run all 100,000 in parallel? If not, set a cap on how
many requests can run in parallel.

More information about the Twisted-Python mailing list