[Twisted-Python] My twisted web server fall down

Michael Hudson micahel at gmail.com
Sun May 24 05:24:52 EDT 2009

2009/5/24 Muaaz Hussain <muaazhussain128 at gmail.com>:
> Dear all,
> I ran penetration testing tool against my twisted web server , the
> tool used to make a huge number of threads, all that threads make a
> connection to the twisted concurrently.
> when I made the number of threads more than 1024 the twisted web
> server eventually has fall down.
> is there any method to let the twisted web server to limit the
> concurrent connection per second or per host.

The twisted.protocols.policies module contains factories that limit
connections per peer or total connections:

There isn't one for connections per second, but I don't suppose it
would be too hard to write (and I might get around to writing it one
of these days, we could use it).

If you're really worried about attacks, it's probably better to do
this at the iptables/kernel level if you can though.


More information about the Twisted-Python mailing list