31st JULY - 4th AUGUST 2015

Pullman Brisbane - King George Square

Menu
Create Account
  • Mini-Conferences
    July 31
  • Presentations
    August 1-2
  • Sprints
    August 3-4

<-- Back to schedule

Using benchmarks to understand how WSGI servers work.

During the development of a Python web application the inbuilt development web server provided by the web framework is often what is used. When moving to a production environment, one has to choose a more capable production grade WSGI deployment mechanism. Which of the various WSGI servers available is going to be the most suitable is going to depend on a range of criteria related to your specific web applications requirements.

Unfortunately, rather than look at the bigger picture and what would be the most suitable across such criteria, many people will simply rush to trying to run an overly simplistic benchmark on the various WSGI servers and make the decision based purely on perceptions of whether one WSGI server is faster than the alternatives. Worse, they don't even attempt to do the benchmarks themselves and instead rely on benchmarks published on some public blog site.

Such public benchmarks as are available are often flawed, or cover such a narrow use case as to in no way be relevant to that users own specific situation.

A further problem with such benchmarks is that they try and evaluate the performance of a WSGI server as if they are a black box. As such, there is no attempt to try and work out what is actually going on within the WSGI server and why it is exhibiting the behaviour it is.

The purpose of this talk is to explore a number of different micro benchmarks, using them to work out what is actually going on within a WSGI server when they are run. The analysis will delve down into, and look at the different ways that WSGI servers are implemented and deployed. The behaviour under the different benchmarks will be determined using fine grained metrics captured from hooking instrumentation into the WSGI servers themselves.

As there are many factors which could be investigated, the talk cannot be entirely comprehensive, but selected benchmarks drawing from a sub set of the following areas will be presented:

* multithreading
* CPU intensive tasks
* long running requests
* combination of short and long running requests
* large request content uploads
* large amounts of response content
* blocking on back end services
* slow HTTP clients

The tests will look not just at response times, but also server capacity utilisation, CPU and memory utilisation.

Although the discussion will primarily revolve around WSGI servers, a comparison will also be made for some tests were one instead to use an ASYNC web application framework alone, or in conjunction with a WSGI adapter.

To conclude, an attempt will be made to summarise what you should be looking at in a WSGI server to determine if it is the right choice for your use case.

Graham Dumpleton

Graham has been using the Python programming language since the days when the only way to obtain it was as shar files over Usenet news groups. He is the author of mod_wsgi, a module for hosting Python web applications with Apache, as well as the wrapt module, a package designed for creating robust decorators and for monkey patching. Graham is a Fellow of the Python Software Foundation and a member of the Apache Software Foundation.