On 1 Jan 2006 14:44:07 -0800, mojosam <[EMAIL PROTECTED]> wrote:
>I guess I'm a little confused, and this certainly comes from not yet
>having tried to do anything with Python on a web server.
>
>I remarked once to a Python programmer that it appeared to me that if I
>had a web page that called a Python program, that the server would:
>1. Load Python
>2. Run the program
>3. Unload Python

This is true of any CGI.  It is part of the definition of CGI.

>
>Then the next time it has to serve up that page, it would have to
>repeat the process.  This seems inefficient, and it would slow the site
>down.  The programmer confirmed this.  He said that's why I should use
>mod_python.  It stays resident.

There are lots of ways to write web applications aside from CGIs.  mod_python 
is one.

>
>Is this advice accurate?  Are there other things to consider?  Isn't
>there just some way (short of running something like Zope) that would
>keep Python resident in the server's RAM?  This is a shared server, so
>the web host probably doesn't like stuff sitting around in RAM.

Using Twisted, FastCGI, SCGI, or even BaseHTTPServer in the standard library 
will address /this/ particular issue (there are lots of other solutions, too, 
not just these four).  Some of them may address other issues better or worse 
than others.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to