Sloooooowwwww WSGI restart
alex at a13x.net
Thu Jan 29 21:12:44 CET 2009
On Thu, Jan 29, 2009 at 1:00 PM, Graham Dumpleton
<Graham.Dumpleton at gmail.com> wrote:
> In other words, it is not universal that any code change will be
> automatically detected and a reload occur. There are also various
> caveats on what mod_python module importer does, as it is reloading
> modules into an existing process and not restarting the whole.
> If you are not careful, weird things can happen.
Considering I'm not changing any of the modules (ie. working only on the
source tree in the project itself which is published by mod_python.publisher)
I haven't seen the need to restart Apache.
There are caveats, of course - but in day-to-day work, I haven't noticed
any difficulties and need to fully restart Apache.
> It was a general statement. There are various people on different
> forums and irc channels who keep saying that a full Apache restart is
> required with Apache/mod_wsgi when making code changes. Am just
> stating for the record that that isn't true.
We agree here. Someone posted a link earlier explaining the settings of
mod_wsgi (maybe it was you) where it's easy to configure it to detect
code changes and reload the code. Hence my questions from the begining
of the thread.
There are custom built code-reloading modules (and techniques) which can
also be used.
> So, depends on how closely you want your development environment to
> mirror production so that issues are picked up sooner, rather than
> only at the point of deployment to a production system when you are
> under pressure.
Ideally, you would want the environments to be as closely related (in terms
of setup) as possible. In my development, i try to keep the integration
environment a mirror of production, but (as mentioned) keep the local (dev)
environment as suitable to my needs as possible.
Continuous integration system would help in deploying the code to integration
for integration testing and final checks before hitting production (which is a
Rushing things into production is never a good think(tm). All it needs is a bit
of careful planning, but I'm going way too off-topic here.
a lex 13 x
More information about the Python-list