ido.nl.eu.org/django-unscientific-benchmark-21-12-2007/

Django an Unscientific Benchmark between mod_python / mod_wsgi / aspen and runserver

Information

Tests are executed with Apache's ab2 tool running on the same machine as the server was. There is no explicit caching done in Django. CachingMiddleware was not enabled and otherwise default settings where used.

    Test System, workstation:
  • core2duo 6700 2 x 2.66GHz
  • 2GB Internal Memory

Test Pages

Frontpage View is a custom Django view, rendered as a template of roughly 12kb in size. It contains several database queries, like a tagcloud, top 3 articles, top 10 authors and some others. These are not cached, the database is mostly empty and contains just enough information for the site to work as espected. Database backend used for the tests is SQLite.

Static template was roughly 15kb in size.

Results

Django 'frontpage' View: ab -n 1000 -c 10 http://localhost/

aspen:19.71rps
django-runserver:12.07rps
apache-mod_python:32.58rps
apache-mod_wsgi-embedded:36.01rps
apache-mod_wsgi-daemon(25 threads):18.08rps
apache-mod_wsgi-daemon(5 processes):33.63rps
apache-mod_wsgi-daemon(15 processes):35.98rps
apache-mod_wsgi-daemon(5 processes 5 threads):35.56rps

Django 'static' Template: ab -n 1000 -c 10 http://localhost/wj1/

aspen:111.50rps
django-runserver:66.61rps
apache-mod_python:156.82rps
apache-mod_wsgi-embedded:166.76rps
apache-mod_wsgi-daemon(25 threads):108.97rps
apache-mod_wsgi-daemon(5 processes):191.10rps
apache-mod_wsgi-daemon(15 processes):192.64rps
apache-mod_wsgi-daemon(5 processes 5 threads):189.75rps

TODO

Improvements on this unscientific benchmark

  • use postgresql as database backend.
  • include full ab2 output.
  • also test with some other benchmark tool like httperf.
  • use multiple urls, also download static media and other assest to mimic a user browsing more closely.
  • create graphs of the results. (everybody loves graphs)
  • use dedicated server
  • also include test where run benchmark programs from other system
  • include configuration files
  • try to meassure multile time points on the server, possible by using aggressive caching, to identify time spend on database, calculations and django itself.
  • benchmark static template on plain webserver (without any django processing)
A Django site.