Is there a way to safely restart mod_wsgi processes on demand, possibly running on multiple machines? I'm serving a django app with mod_wsgi in daemon mode with apache:
WSGIDaemonProcess myapp user=user group=user processes=30 threads=1
WSGIProcessGroup myapp
I read the suggestions in the mod_wsgi documentation but none of the suggested solutions works for me:
- Running a monitoring script is not recommended in a production system.
- Sending kill signals is not safe in my case. I want to avoid interrupting running requests. The reload must not bring the service down. Slowing down is fine.
- Touching the
mod_wsgiconfiguration file does the trick safely, but how to do it on multiple machines?
Ideally we should be able to restart the processes with one action. Any suggestions?
Note: I have to run multiple processes with one thread. My application is not thread safe.
Edit, I can do it from Puppet if that is the only option I have. but I prefer if there a way to do it from a special protected view. I think this is trivial to do on one machine but not multiple ones
Thanks a lot