Lightweight Python deployment servers

Luit van Drongelen

uWSGI

Who am I?

What is this talk about?

Lightweight deployment servers for Python web applications.

Specifically: not using Apache.

Especially: when Nginx is serving static files for you.

Why I'm the one telling you?

I code Python for fun (and hopefully eventually profit).

Running Apache on a Virtual Private Server with limited resources (256MB of RAM, mediocre I/O performance) isn't much fun.

For the last few years I ran uWSGI on my servers, and I feel like I should advocate it.

What's wrong with Apache?

Using nginx can more than double the response rate for static files, especially with lots of concurrent connections.

Nginx does this while requiring only a fraction of the memory that Apache uses.

Apache pulls configuration from .htaccess files, causing higher I/O load than nginx with similar tasks.

Nginx can natively connect to uWSGI (since nginx 0.8.40)

So what is this uWSGI thing?

uWSGI is a fast, self-healing and developer/sysadmin-friendly application container server coded in pure C.

Born as a WSGI-only server, over time many features were added.

It uses the uwsgi (note the lowercase) protocol to communicate to webservers like nginx.

It's tested on Linux 2.6, Solaris/OpenSolaris, OpenBSD, NetBSD, FreeBSD >= 8.0, MacOS X, Nexenta, and Haiku, for some of those even working on architectures like SPARC64 and ARM.

So why use uWSGI?

It's a great WSGI server.

So that's it?

Nope. It's more than a WSGI server:

And there's much more.

Demonstration

Source: opencompute.org

Why was this just about uWSGI?

I know, there's more.

uWSGI is a project I've kept a close eye on recently, and used almost exclusively.

Some other WSGI servers show great performance too. uWSGI just performs great and has the best feature-set.

Why were all the titles questions?

I don't know...

Got any better questions than this?

Thank you for your attention