[Twisted-Python] Re: twisted application server

Phil Mayers p.mayers at imperial.ac.uk
Fri Mar 7 08:36:45 EST 2008

Andreas Kostyrka wrote:
> Actually, on a modern system like Linux, if you fork, the process share
> memory as long it's not written too (Copy-on-Write).
> This means, that if you'd fork off your process pool from your
> application, forking should have minimal impact. Even writing it as a
> standalone process means memory usage of one Python interpreter, plus
> minimal usage in the forked processes.

If you fork a python interpreter, you should very quickly replace the 
process with exec.

The reason is that if you de-reference something, Python might 
deallocate it in a way that causes the parent process to lose it too 
e.g. send a shut down message on SQL connections.

More information about the Twisted-Python mailing list