Skip to content

Recommended galah.web Server Stack

brownhead edited this page Jun 24, 2012 · 3 revisions

These are a bit like working notes for myself

Overview

You are of course free to use whatever server stack you would like (though some things are baked in that you can't change such as MongoDB) but listed here is the recommended stack.

  • CentOS (os)
  • nginx (reverse proxy and static file server)
  • uWSGI (WSGI application container)

More detail will be added later.

uWSGI

uWSGI is a web server that encapsulates one or more WSGI applications. It is meant to act behind a "more featureful" web server like nginx. uWSGI handles the specific tasks of creating multiple instances of our application, ensuring the application is served data in the correct manner (via the WSGI interface), and any other WSGI tasks that web servers like nginx can't be expected to support.

WSGI

WSGI is an interface (as in a set of exposed functions and methods) that acts as a common ground (like a communication protocol even though the WSGI specification doesn't actually specify how to put anything through the wire) between a web server and a Python web application that is built on top of the WSGI interface. This Wikipedia article is definitely worth reading.

uwsgi Protocol

The uWSGI server wants its requests served to it (and will return responses) over the wire in a way that conforms to the uwsgi protocol.

The protocol is a binary protocol (meaning no string parsing is involved) and is designed to transfer HTTP requests/responses after/before they are processed (the web server already parsed the request, why do it again). Support for the protocol is built into nginx making configuration a breeze.