Python common web framework simple performance test results sharing (including Django, flask, bottle, Tornado)

Source: Internet
Author: User
The simplest performance of the Django, flask, bottle, Tornado framework itself is measured. The performance of Django is completely silent.

Django, flask, bottle all use Gunicorn+gevent to start, single process, and turn debug off, and the request returns only one string OK.

Tornado start directly, other content is consistent.

The test software is siege, the test OS is CENOS6 64-bit, the test command is:

Copy the Code code as follows:


Siege-c 100-r 100-b http://127.0.0.1:5000/


The Django test results are:
Copy CodeThe code is as follows:


transactions:10000 Hits
availability:100.00%
Elapsed time:18.51 secs
Data transferred:0.02 MB
Response time:0.18 secs
Transaction rate:540.25 trans/sec
throughput:0.00 mb/sec
concurrency:99.35
Successful transactions:10000
Failed transactions:0
Longest transaction:0.30
Shortest transaction:0.12


Django (remove all middleware) test results are:
Copy CodeThe code is as follows:


transactions:10000 Hits
availability:100.00%
Elapsed time:12.97 secs
Data transferred:0.02 MB
Response time:0.13 secs
Transaction rate:771.01 trans/sec
throughput:0.00 mb/sec
concurrency:99.41
Successful transactions:10000
Failed transactions:0
Longest transaction:0.28
Shortest transaction:0.12


Flask test Results are:
Copy CodeThe code is as follows:


transactions:10000 Hits
availability:100.00%
Elapsed time:5.47 secs
Data transferred:0.02 MB
Response time:0.05 secs
Transaction rate:1828.15 trans/sec
throughput:0.00 mb/sec
concurrency:96.25
Successful transactions:10000
Failed transactions:0
Longest transaction:0.11
Shortest transaction:0.00


Bottle test results are:
Copy CodeThe code is as follows:


transactions:10000 Hits
availability:100.00%
Elapsed time:4.55 secs
Data transferred:0.02 MB
Response time:0.04 secs
Transaction rate:2197.80 trans/sec
throughput:0.00 mb/sec
concurrency:96.81
Successful transactions:10000
Failed transactions:0
Longest transaction:0.09
Shortest transaction:0.00


Tornado test Results are:
Copy CodeThe code is as follows:


transactions:10000 Hits
availability:100.00%
Elapsed time:7.06 secs
Data transferred:0.02 MB
Response time:0.07 secs
Transaction rate:1416.43 trans/sec
throughput:0.00 mb/sec
concurrency:99.51
Successful transactions:10000
Failed transactions:0
Longest transaction:0.09
Shortest transaction:0.01


The performance of the pure frame itself is:
Copy CodeThe code is as follows:


Bottle > Flask > Tornado > Django


Actual use:

Tornado uses asynchronous drivers, so when writing business code, the performance of a bit of synchronization will drop sharply.
Bottle need to implement too many things, plus do not know what performance will be;
Flask performance is slightly near, but the surrounding support has been very rich;
Django does not say, performance has been unable to see, the only advantage is that the development of the shelves have been set up, the development speed is much faster

Because recently was worrying about a project selection, so it was measured, recorded here.

The ps:2014-6-23 was re-tested using the CENTOS6 64-bit, resulting in more matching results with the production environment and modifying the article.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.