Gertjan:>> If I'm not mistaken, mod_wsgi_express runs in a virtualenv?
Graham:
> If you are using virtual environments, yes, it would be installed into that. Each virtual environment would have its own copy if you had more than one, allowing different Python versions to be used. A separate instance of it would be run for each application in respective virtual environments.
Apologies, I see now that I did not mention this in my original post.
Yes, I use virtual environments for all applications. (Two use Django,
two use Flask.) Do you see any disadvantages in such a setup?
Graham:> That combined with a typical Apache installation not being
setup very well for Python applications, means that total memory usage
may not be much different, especially if using frameworks like Django.
In fact, the better configuration of mod_wsgi-express may make it better
overall if you weren't using daemon mode, as you can tune further each
mod_wsgi-express instance to needs of a specific application. This means
if you have one application that needs a multi process configuration,
you aren't then bloating out size used by others unnecessarily. Memory
use would be least of my concerns.
I'm not sure what you're saying here. The setup I thought you were
suggesting was one mod_wsgi (express) for each application, all of them
behind the "system" Apache functioning as a proxy. I don't know if I am
currently us "daemon mode", Apache setup is a black art to me. I have
currently made no special provisions for the applications (that I can
think of), other than specify WSGIScriptAlias. I did do (I see now) some
configuration in wsgi.conf: WSGIDaemonProcess and WSGIProcessGroup.
I don't expect tuning to be necessary, but it would be nice, if I felt
the urge to try some, that the results be contained to one site, and not
influence all of them like now. It seems the mod_wsgi per virtualenv is
ideal for that.
Graham:
> There wasn't any real interest in the community for having curated container images for Python web application hosting that used best practices. Everyone wanted to build their own from scratch. After all, docker was a shiny new tool and was silly to think you could deprive people of their opportunity to waste lots of time learning it, making lots of mistakes, but still come up with only a half baked solution that sort of worked. ;-)
I've had too many occasions of not understanding Apache and/or mod_wsgi
configuration not to appreciate having that done right for me. :-) It is
unfortunate that the images didn't get more interest.
I would like to move to the latest available Python version. Docker was
certainly an option for me, but it seems that it would require perhaps
even more tinkering than virtualenv+mod_wsgi-express. So currently that
is my favorite option. (I won't have time to actually try something
until the weekend.)
Thanks again, regards,
Gertjan.