[mod_python] webinterface for a local telnet server

Andreas Klauer Andreas.Klauer at metamorpher.de
Fri Oct 6 21:53:33 EDT 2006

On Sat, Oct 07, 2006 at 09:18:13AM +1000, Graham Dumpleton wrote:
> Before I try and address that I would ask why you are trying to perhaps
> reinvent the wheel as others have already solved this problem.

It's probably hard not to reinvent the wheel when what you want is 
something as trivial as a telnet web application frontend, um, thingy. 
I want it to be small, lightweight, and specifically adapted for my needs, 
that is the sole reason why I am doing it.

> Back to your threads. The problem with using Apache/mod_python when
> you want to preserve some state between requests is not threads but
> processes. This is because when using prefork or worker Apache MPMs
> on UNIX systems, subsequent requests can be directed to different Apache
> child processes. As a result, if one child process had initiated a  
> telnet connection, when a subsequent request arrives and it ends up being
> processed by a different child process, it will not have access to  
> the open connection. On Win32 boxes this isn't a problem, as there is only one
> Apache process and all requests are handled by it.

Thank you for this clarification. I could not find that information 
anywhere although I was desparately looking for it. All I found was 
persistence this and persistence that and I noticed that there was 
no real persistence at all (at least the way I understand it).

Unless I missed the explanation somewhere, maybe this should go to 
some obvious place like the FAQ?

> Also, even if there were some way, Apache is allowed to shutdown 
> specific child processes at any time, so you would loose any open 
> connection anyway.

Especially this part is worth mentioning. Thanks. So there really 
is no way but to use some daemon independent from Apache.

Thanks for all the replies. :-)

Although that means I will need to write a daemon for almost anything 
that needs persistence (databases don't except for performance reasons).

Andreas Klauer

More information about the Mod_python mailing list