Django, Tornado, Flask 성능 테스트 비교
1000의 경우
Concurrency Level: 500
Time taken for tests: 3.009 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 1915000 bytes
HTML transferred: 1767000 bytes
Requests per second: 332.30 [#/sec] (mean)
Time per request: 1504.655 [ms] (mean)
Time per request: 3.009 [ms] (mean, across all concurrent requests)
Transfer rate: 621.44 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 94 291.0 0 1000
Processing: 14 112 315.5 22 2007
Waiting: 7 108 315.8 19 2006
Total: 14 206 583.2 22 3004
Percentage of the requests served within a certain time (ms)
50% 22
66% 24
75% 25
80% 27
90% 219
95% 2006
98% 2412
99% 2607
100% 3004 (longest request)
5000은 힘들죠.
Concurrency Level: 500
Time taken for tests: 68.403 seconds
Complete requests: 4651
Failed requests: 0
Total transferred: 8906665 bytes
HTML transferred: 8218317 bytes
Requests per second: 67.99 [#/sec] (mean)
Time per request: 7353.535 [ms] (mean)
Time per request: 14.707 [ms] (mean, across all concurrent requests)
Transfer rate: 127.16 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 91 447.6 0 7011
Processing: 13 528 4209.0 22 52579
Waiting: 4 526 4208.8 20 52579
Total: 13 619 4453.8 22 55584
Percentage of the requests served within a certain time (ms)
50% 22
66% 23
75% 24
80% 25
90% 28
95% 1020
98% 7230
99% 17066
100% 55584 (longest request)
Tornado 성능 테스트
1000의 경우
Concurrency Level: 500
Time taken for tests: 0.622 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 205000 bytes
HTML transferred: 12000 bytes
Requests per second: 1606.50 [#/sec] (mean)
Time per request: 311.236 [ms] (mean)
Time per request: 0.622 [ms] (mean, across all concurrent requests)
Transfer rate: 321.61 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 3.9 0 13
Processing: 2 77 22.4 76 282
Waiting: 2 77 22.4 76 282
Total: 14 79 22.0 76 282
Percentage of the requests served within a certain time (ms)
50% 76
66% 81
75% 82
80% 82
90% 84
95% 95
98% 167
99% 170
100% 282 (longest reques
5000 상황
Concurrency Level: 500
Time taken for tests: 3.877 seconds
Complete requests: 5000
Failed requests: 0
Total transferred: 1025000 bytes
HTML transferred: 60000 bytes
Requests per second: 1289.54 [#/sec] (mean)
Time per request: 387.734 [ms] (mean)
Time per request: 0.775 [ms] (mean, across all concurrent requests)
Transfer rate: 258.16 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 61 238.2 0 1001
Processing: 2 201 522.7 75 2866
Waiting: 2 201 522.7 75 2866
Total: 17 262 750.6 75 3866
Percentage of the requests served within a certain time (ms)
50% 75
66% 76
75% 78
80% 80
90% 90
95% 3003
98% 3811
99% 3841
100% 3866 (longest request)
10000원 끊을게요.
Flask 테스트
1000의 경우 999에 죽는다
Concurrency Level: 500
Time taken for tests: 0.668 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 166000 bytes
HTML transferred: 12000 bytes
Requests per second: 1496.62 [#/sec] (mean)
Time per request: 334.087 [ms] (mean)
Time per request: 0.668 [ms] (mean, across all concurrent requests)
Transfer rate: 242.62 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.4 0 5
Processing: 1 66 23.0 68 518
Waiting: 1 66 22.9 68 518
Total: 6 66 22.4 68 522
Percentage of the requests served within a certain time (ms)
50% 68
66% 69
75% 69
80% 70
90% 72
95% 73
98% 74
99% 74
100% 522 (longest request)
5000 상황에서
Concurrency Level: 500
Time taken for tests: 4.441 seconds
Complete requests: 4677
Failed requests: 0
Total transferred: 776382 bytes
HTML transferred: 56124 bytes
Requests per second: 1053.15 [#/sec] (mean)
Time per request: 474.764 [ms] (mean)
Time per request: 0.950 [ms] (mean, across all concurrent requests)
Transfer rate: 170.73 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 10 98.7 0 1003
Processing: 1 62 72.8 56 1058
Waiting: 1 62 72.8 56 1057
Total: 8 72 162.9 56 2058
Percentage of the requests served within a certain time (ms)
50% 56
66% 57
75% 57
80% 57
90% 58
95% 58
98% 64
99% 480
100% 2058 (longest request)
테스트된 코드:Django:직접 사용
django-admin startproject django_test
python manage.py startapp app_test'
python manage.py migrate
python manage runserver
Tornado
#!/usr/bin/env python3
# coding=utf-8
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app = make_app()
app.listen(8888)
tornado.ioloop.IOLoop.current().start()
Flask
#!/usr/bin/env python3
# coding=utf-8
from flask import Flask
import logging
app = Flask(__name__)
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(port=8888, debug=False)
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.