私はHerokuで遊んで、Djangoアプリにどれだけ適しているかをテストしています。
2つのアクションを持つ単純なプロジェクトを作成しました。
- シンプルなHelloWorldを返す
- 画像を生成し、応答として送信します
以前siege -c10 -t30s
は、Django開発サーバーとgunicorn(両方ともHerokuで実行)の両方をテストしていました。これらは私の結果です:
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
画像の生成
-djangodev
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
使用
した-Django1.4
-
Gunicorn0.14.6 --venv
なぜgunicornはとても遅いのですか?
//UPDATE
両方のテストがHeroku環境で実行されていました開発サーバーは標準のdjangoサーバーを意味します-それによって実行できますここpython manage.py runserver
で説明されています。