python-webapp-etc -- config files for tools to deploy Python webapps
This repository is a collection of configuration files for a common Python webapp deployment. This collection of tools is currently used in production at Bueda.
Tools & Services
Gunicorn is "a Python WSGI HTTP Server for UNIX." It's
fast, easier to use than Apache's
mod_wsgi, and has first-class support
for frameworks like Django and Paster.
Gunicorn doesn't handle slow clients, so the makers "strongly advise that you use Nginx" to proxy incoming requests. We also use the nginx proxy to serve static files.
We use runit (that's "run-it", not "r-unit" as I thought for many months...) to create init-style scripts for each application's gunicorn process.
This also offers a workaround for a memory leak in
celeryd when it runs in
DEBUG mode. If the
celeryd process consumers over some set amount of memory
god can bounce it for you automatically.
We direct Python's logging module to the syslog, and use rsyslog to split out each application's logs into individual files. Rsyslog can also send these logs to a central server, split by date, etc.
If you have improvements to this configuration:
- Fork the repository on GitHub
- File an issue for the bug fix/feature request in GitHub
- Create a topic branch
- Push your modifications to that branch
- Send a pull request