[Twisted-Python] twisted.web performance hacks

Paul Boehm paul at soniq.net
Thu Dec 18 07:56:12 EST 2003

On Thu, Dec 18, 2003 at 12:41:58AM -0500, Itamar Shtull-Trauring wrote:
> On Wed, 2003-12-17 at 20:23, Michal Pasternak wrote:
> > Everything works very good right until simultaneous connection number is
> > below 40. I just thought it was a hard limit set in the source (DoS
> > protecition?) or something similar. If you deny the existence of such limit,
> > I'll proceed with examination of the situation.
> No such limit is hardcoded.

anyone thought about writing multi-process twisted applications yet?

looking at examples/web.py, it would be easy to do

reactor.listenTCP(1999, site)
for x in xrange(1,5):
    if os.fork() == 0:

for shared dynamic data you'd of course have to use something along the lines
of pb+remotecache, but if i'm not mistaken, for some applications this kind of
hack might give a performance edge, especially on multiprocessor machines.

in particular twisted.web could improve in benchmarks when being able to
emulate classical application behaviour for performance reasons
(no shared data between different connection handlers)


More information about the Twisted-Python mailing list