squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.62k stars 580 forks source link

I ported japronto to raspberry PI and used wrk stress testing. #178

Closed junbaibai0719 closed 3 years ago

junbaibai0719 commented 3 years ago

The code is from example async.py 。 I don't know why asynchronous functions are so inefficient on raspberry, while synchronous functions are more efficient than my PC.

(base) lin@DESKTOP-A5K2NJM:~/Downloads$ wrk -t12 -c10000 -d30s http://192.168.137.99:8081/async --latency

Running 30s test @ http://192.168.137.99:8081/async

12 threads and 10000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 0.00us 0.00us 0.00us -nan% Req/Sec 157.87 250.45 1.26k 84.34% Latency Distribution 50% 0.00us 75% 0.00us 90% 0.00us 99% 0.00us 9081 requests in 30.08s, 860.21KB read Socket errors: connect 8987, read 0, write 0, timeout 9081 Requests/sec: 301.88 Transfer/sec: 28.60KB (base) lin@DESKTOP-A5K2NJM:~/Downloads$ wrk -t12 -c10000 -d30s http://192.168.137.99:8081/sync --latency Running 30s test @ http://192.168.137.99:8081/sync 12 threads and 10000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 17.16ms 3.59ms 411.56ms 92.54% Req/Sec 4.87k 2.07k 10.33k 53.36% Latency Distribution 50% 16.92ms 75% 17.23ms 90% 18.30ms 99% 29.11ms 1737912 requests in 30.06s, 160.77MB read Socket errors: connect 8987, read 0, write 0, timeout 0 Requests/sec: 57809.81 Transfer/sec: 5.35MB