I am playing with Heroku to test how good it is for Django apps.
I created a simple project with two actions:
- return simple hello world
- generate image and send it as response
I used siege -c10 -t30s
to test both Django dev server and gunicorn (both running on Heroku). These are my results:
Simple hello world
- django dev
Lifting the server siege... done.
Transactions: 376 hits
Availability: 100.00 %
Elapsed time: 29.75 secs
Data transferred: 0.00 MB
Response time: 0.29 secs
Transaction rate: 12.64 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 3.65
Successful transactions: 376
Failed transactions: 0
Longest transaction: 0.50
Shortest transaction: 0.26
- gunicorn
Lifting the server siege... done.
Transactions: 357 hits
Availability: 100.00 %
Elapsed time: 29.27 secs
Data transferred: 0.00 MB
Response time: 0.27 secs
Transaction rate: 12.20 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 3.34
Successful transactions: 357
Failed transactions: 0
Longest transaction: 0.34
Shortest transaction: 0.26
generating images
- django dev
Lifting the server siege... done.
Transactions: 144 hits
Availability: 100.00 %
Elapsed time: 29.91 secs
Data transferred: 0.15 MB
Response time: 1.52 secs
Transaction rate: 4.81 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 7.32
Successful transactions: 144
Failed transactions: 0
Longest transaction: 4.14
Shortest transaction: 1.13
- gunicorn
Lifting the server siege... done.
Transactions: 31 hits
Availability: 100.00 %
Elapsed time: 29.42 secs
Data transferred: 0.05 MB
Response time: 7.39 secs
Transaction rate: 1.05 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 7.78
Successful transactions: 31
Failed transactions: 0
Longest transaction: 9.13
Shortest transaction: 1.19
I used
- Django 1.4
- Gunicorn 0.14.6
- venv
Why is gunicorn so slow?
//UPDATE
Both tests were running in Heroku envirenment
dev server means standard django server - it can be ran by python manage.py runserver
it is described here.