bretth / woven

[UNMAINTAINED] Woven is a Python library built on Fabric to deploy versioned Django projects served by Apache and Nginx on Linux servers.
http://readthedocs.org/docs/woven
BSD 3-Clause "New" or "Revised" License
106 stars 10 forks source link

Webserver backends #19

Open bretth opened 13 years ago

bretth commented 13 years ago

Woven should support webserver [xyz].

Woven currently supports just a combination of nginx, apache, and modwsgi simply because this is probably the most flexible, mature combination that comes packaged with Ubuntu, and modwsgi is the "recommended way to get Django into production". Since your django project is always going make the fastest webserver run like a Ferrari in peak hour traffic, the question should be how do you ensure your Ferrari doesn't overheat and breakdown in peak hour, thus causing much embarrassment, and caching is going to be your answer before your choice of wsgi server. Every webserver/django benchmark I've seen strips out real life project necessities to show performance which makes the figures meaningless except for bragging rights.

That said there is no question that there are other projects like gnuicorn and uwsgi are growing in popularity and combine ease of configuration with good memory efficient performance and modern features so I'd like to support them if I can.

The strategy and requirement for supporting any web/wsgi server in Woven would be:

1) Require it to be available as a package through apt-get (currently rules out uwsgi atm). 2) Require standard startup scripts, graceful respawn/restart external to woven. 3) Abstract the woven webserver related setupnode and deploy functions 4) Implement woven webserver specific backends 5) Minimal configuration. Woven setupnode should detect which webserver package/combination is configured in the list of packages to be installed - then use a corresponding backend.

I think the priority for 1.0 will be to get the api for backends in place, and then implement backends at will. Gunicorn in particular should be solid enough in Ubuntu 11.04 (if it isn't already). Not sure about uwsgi, it needs to be compiled to use with the dist specific version of Ubuntu (I think) which I don't want to do through woven, hence we need to see it packaged in a form that will just work with whatever version of nginx is installed.

We'll use this issue to track the implementation of a documented api for backends to support. Once that is complete we can add in specific backends as issues.

ghost commented 13 years ago

With regards to

1) It's possible to pip install uwsgi http://projects.unbit.it/uwsgi/wiki/Install

1) + 2) http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582864

bretth commented 13 years ago

So Nginx natively supports uwsgi from 0.8.x which means Ubuntu Natty will support uwsgi out of the box, but still need to use a PPA to install it which is fine. After trying out gunicorn I think explicit backends are overkill for the moment, so adding in uwsgi in April for Ubuntu 11.04 users will be trivial.

ghost commented 13 years ago

agreed, sounds resonable. However, about the uWSGI .deb for Ubuntu ... where did you get the information that there will in fact be a uWSGI .deb? From the link I posted above it looks rather unlikely that we will see a uWSGI .deb for Debian soon :-/