# sanic-server **Repository Path**: kalaidi/sanic-server ## Basic Information - **Project Name**: sanic-server - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-07 - **Last Updated**: 2022-03-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - sanic - aiomysql + orm - aioredis - async + scheduler --- 压测环境 - cpu: i5-8250u - ram: 16g - ubuntu: 20.04 - python: 3.8.5 - wrk: 4.1.0 --- ### 1.纯get请求 #### 1.access_log=True,work=1 ``` 启动: app.run(host="0.0.0.0", port=9002, workers=1, debug=False, access_log=True) 压力: wrk -t10 -c400 -d10s --latency http://127.0.0.1:9002/ 结果: Running 10s test @ http://127.0.0.1:9002/ 10 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 46.21ms 10.54ms 321.73ms 88.36% Req/Sec 843.55 214.07 4.74k 82.46% Latency Distribution 50% 46.27ms 75% 47.15ms 90% 48.76ms 99% 66.26ms 83940 requests in 10.10s, 12.49MB read Requests/sec: 8310.89 Transfer/sec: 1.24MB ``` #### 2.access_log=False, work=1 ``` 启动: app.run(host="0.0.0.0", port=9002, workers=1, debug=False, access_log=False) 压力: wrk -t10 -c400 -d10s --latency http://127.0.0.1:9002/ 结果: Running 10s test @ http://127.0.0.1:9002/ 10 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 21.99ms 3.88ms 247.30ms 89.68% Req/Sec 1.77k 246.58 2.62k 81.60% Latency Distribution 50% 22.55ms 75% 22.69ms 90% 22.87ms 99% 24.75ms 176202 requests in 10.04s, 26.21MB read Requests/sec: 17548.95 Transfer/sec: 2.61MB ``` ### 2.orm #### 1.access_log=True,work=1 ``` 启动: app.run(host="0.0.0.0", port=9002, workers=1, debug=False, access_log=True) 压力: wrk -t10 -c400 -d10s --latency http://127.0.0.1:9002/testorm 结果: Running 10s test @ http://127.0.0.1:9002/testorm 10 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 165.81ms 13.63ms 331.00ms 82.27% Req/Sec 234.97 93.24 404.00 63.31% Latency Distribution 50% 167.07ms 75% 171.31ms 90% 176.34ms 99% 191.67ms 23305 requests in 10.03s, 6.80MB read Requests/sec: 2322.99 Transfer/sec: 694.18KB ``` #### 2.access_log=False, work=1 ``` 启动: app.run(host="0.0.0.0", port=9002, workers=1, debug=False, access_log=False) 压力: wrk -t10 -c400 -d10s --latency http://127.0.0.1:9002/testorm 结果: Running 10s test @ http://127.0.0.1:9002/testorm 10 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 130.27ms 20.70ms 344.31ms 84.01% Req/Sec 294.68 134.25 757.00 75.61% Latency Distribution 50% 134.42ms 75% 136.84ms 90% 143.67ms 99% 157.29ms 29219 requests in 10.03s, 8.53MB read Requests/sec: 2912.10 Transfer/sec: 870.22KB ```