Share the simple Performance Test Results of common python web frameworks (including django, flask, bottle, tornado) and djangoflask

Source: Internet
Author: User

Share the simple Performance Test Results of common python web frameworks (including django, flask, bottle, tornado) and djangoflask

Tested the simplest performance of django, flask, bottle, and tornado frameworks. The performance of django is completely speechless.

Django, flask, and bottle are all started using gunicorn + gevent, single process, and DEBUG disabled. Only one string OK is returned for requests.

Tornado is directly started by itself, and other content is consistent.

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

Copy codeThe Code is as follows:
Siege-c 100-r 100-B http: // 127.0.0.1: 5000/

Django Test Result:
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 Result:
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:
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

The bottle test result is:
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:
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

It can be seen that the performance of the pure framework itself is:
Copy codeThe Code is as follows:
Bottle> flask> tornado> django

Combined with actual use:

Tornado uses an asynchronous driver. Therefore, when writing business code, the performance will decrease sharply if synchronization is time-consuming;
There are too many things that need to be implemented by the bottle itself, and I don't know what the performance will do after the addition;
The flask performance is a little poor, but the surrounding support is already very rich;
Django won't talk about it, and the performance can no longer be viewed. The only advantage is that the development architecture has been set up, and the development speed is much faster.

I'm worried about selecting a project recently, so I tested it and recorded it here.

PS: we re-tested centos6 with 64-bit centos6 to get a better match with the production environment, and modified the article.


Which of the following is the Quick Start for the Python Web framework? Django, Tornado, webpy?

Django is recommended for building a blog, which is easy to learn. There is a good Chinese getting started tutorial "Django_book_2 _ Chinese version" on the Internet. You can search for it in hundreds of times ..

Python has many web frameworks, such as Django and webpy, but which one has the strongest comprehensive strength?

Django and web. py is more powerful than django, but I need to explain: I feel django is too big. It is a waste of time and energy to study it. However, if you use it for development based on his teaching materials, it is easy and labor-saving, and suitable for the whole-site development. However, once special requirements are met, it is difficult to modify them. You have to study its original code, such as admin and input interface, simple use is cool, but customization is too troublesome; web. py is suitable for fast development with a single goal. Although it is not full of django, It is very fast to develop with previous web experience.

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.