[Web-SIG] Re: Preferred set of WSGI servers
Steve Holden
steve at holdenweb.com
Fri Apr 29 19:25:46 CEST 2005
Ian Bicking wrote:
> Peter Hunt wrote:
>
>> Actually, I think a mod_wsgi for Apache and IIS would be one of _the_
>> most important things for WSGI. I think that it would search for a
>> __wsgi__.py file (or maybe something with a better name) which would
>> expose a WSGI application named "application" that would handle
>> requests for the directory in which it exists. This would allow a user
>> to simply drop a file on the webserver and have it work. It would be
>> excellent for shared hosting solutions.
>
>
> Would it? From what I can tell, mod_php is very popular in shared
> hosts, but neither mod_python nor mod_perl are. I don't think mod_*
> makes it necessarily host-friendly. But from what I can tell of
> mod_python, it would be relatively easy to have something like .wsgi
> files, and give them a handler that runs them as WSGI apps.
>
> I can imagine a good setup for hosts being one based on forking per-user
> processes, which is adaptive primarily to scale down -- e.g., a largely
> dorman app could have 1 or even 0 processes running (at 0 it becomes
> similar to CGI, but presumably the process would stay around for some
> time to respond to subsequent requests). The "scaling down" scenario I
> often think about would be a email contact form -- one of those things
> that has to be an app, can be implemented and deployed separately from
> other aspects of the site, and yet it's clear waste of resources to keep
> a process always around to respond to such requests. Though it's
> actually someplace where CGI would work just fine; but lets say you
> don't want to educate the developer about when they might want to use
> other deployment strategies (which is a rather complex discussion
> really, that would be better avoided by providing one really good
> strategy and telling everyone to use it).
>
> Maybe mod_python is appropriate for that kind of situation, I'm not
> sure. It could also be implemented with a second, single process that
> was developed and deployed separately from Apache.
>
> As for IIS and ISAPI, I can't say I really know what the archicture of
> that system is, so I don't know. Oh, but that does remind me of another
> WSGI server: ASP. Though I remember vaguely this came up before and it
> seemed infeasible because ASP didn't support anything like PATH_INFO. Oh
> well, I can't remember now.
>
Seems to me that mod_python isn't really suitable for a shared-hosting
environment because of the need to restart the server when
indirectly-imported modules are updated, a situation that I believe
mod_python does not detect.
This would cause all other hosted sites' sessions to be forcibly
terminated without some persistent-state mechanism that can't be
guaranteed to be present for all sites, and of course most hosting
companies aren't willing to have their customers say when shared-hosting
servers are restarted.
For these reasons I've never pestered any of our service providers to
support mod_python even though I have done quite a bit of experimental
work with it and really quite like that environment.
regards
Steve
--
Steve Holden +1 703 861 4237 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
More information about the Web-SIG
mailing list