IIS with Python

David Bolen db3l at fitlinxx.com
Mon Nov 26 22:48:22 EST 2001


tub4jxr at hotmail.com (Jose Rodriguez) writes:

> I have looked at the Python.org site but I must admit that I am a
> little unsure of whether a separate python interpreter is started on
> each call from a different IIS session that needs to run some Python
> code.

Assuming you are referring to using Python for ASP pages in IIS (and
not via a CGI setup which would I believe be forced to use separate
processes per connection), I think it depends on how you define the
scripting support for that page in IIS, just as with other scripting
languages.

The Python ASP support is implemented via the COM interface registered
by Pythonwin (the win32all package).  So the invocation of the
scripting environment depends on how the COM object is instantiated.

In IIS you can set the scripting support for a page to use one of
three levels of application protection: Low (IIS process), Medium
(pooled) and High (Isolated).  They directly correlate to how the COM
object for the scripting host is invoked.

In low (IIS process), the scripting interpreter is loaded as an inproc
server (via the pythoncom##.dll file), and while I'm not sure if a
separate interpreter is created internally for each user, you won't
have individual processes running on your IIS box - just the one DLL
loaded straight into your IIS process.

In High, a completely separate COM object is instantiated (via
execution of a separate pythonw.exe process running a localserver
script) and you will have a completely separate process for each
connection to the server.

In Medium, a pool of separate COM objects is maintained (I think via
MTS but am not positive), so you'll have separate processes, but not
as many as clients, but several shared among clients.

This should be no different if you are using Python for the ASP
support versus any other windows scripting host language.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list