Thursday 1:30 p.m.–2:20 p.m.

High Performance Django: From Runserver to Reddit Hugs

Peter Baumgartner

Audience level:



Django makes it easy to build a site and get it running on your laptop, but how do you go from there to a site that can gracefully handle millions of page views per day? This talk will show you the modifications and supporting services needed to make your site scale. Topics will include caching, uWSGI, Varnish, and load balancing.


Does Django scale? It's a question that's plagued Django (and every other popular web framework) since the beginning. Disqus, Instagram, and Pinterest are all using Django to handle insane amounts of traffic, so it must scale, right?

The truth is that, left to its own devices, Django scales horribly. In this talk, we'll take runserver as our baseline and piece by piece, add in the supporting cast members to see how they affect the performance characteristics. By the end of the talk we'll have built a web stack that can withstand massive amounts of traffic.

The talk will focus on:

  • The WSGI server: uWSGI (also Gunicorn, Apache)
  • Database caching: Memcached (also Redis)
  • Template caching: Memcached (also Redis)
  • Web Accelerator: Varnish
  • Load Balancer: Varnish (also Nginx, HAProxy, ELB)