The latest version of Robyn now scales across multiple cores!!
PR LInks
Full Changelog: https://github.com/sansyrox/robyn/blob/main/CHANGELOG.md#v080-2021-11-10
You can select the number of processes and workers now:
python3 app.py --workers=5 --processes=5
Performance Comparison [CPU under very heavy strain]
Robyn - 5 Processes and 5 Workers (v0.8.0)
╰─ oha -n 500000 -c 50 http://localhost:5000/ --no-tui ─╯
Summary:
Success rate: 1.0000
Total: 74.1781 secs
Slowest: 0.1318 secs
Fastest: 0.0005 secs
Average: 0.0074 secs
Requests/sec: 6740.5379
Total data: 21.93 MiB
Size/request: 46 B
Size/sec: 302.80 KiB
Response time histogram:
0.002 [49062] |■■■■■■■■■■■■■
0.004 [115710] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.006 [105245] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.008 [72753] |■■■■■■■■■■■■■■■■■■■■
0.010 [54286] |■■■■■■■■■■■■■■■
0.012 [36697] |■■■■■■■■■■
0.014 [22683] |■■■■■■
0.016 [14015] |■■■
0.018 [8920] |■■
0.020 [5815] |■
0.022 [14814] |■■■■
Latency distribution:
10% in 0.0025 secs
25% in 0.0037 secs
50% in 0.0060 secs
75% in 0.0095 secs
90% in 0.0136 secs
95% in 0.0171 secs
99% in 0.0278 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0026 secs, 0.0022 secs, 0.0031 secs
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0001 secs
Status code distribution:
[200] 500000 responses
Robyn - 1 Process and 1 Worker (v0.7.1)
╰─ oha -n 500000 -c 50 http://localhost:5000/ --no-tui ─╯
Summary:
Success rate: 1.0000
Total: 101.4573 secs
Slowest: 0.0858 secs
Fastest: 0.0011 secs
Average: 0.0101 secs
Requests/sec: 4928.1797
Total data: 8.95 MiB
Size/request: 18 B
Size/sec: 90.37 KiB
Response time histogram:
0.003 [617] |
0.005 [23214] |■■■
0.008 [151605] |■■■■■■■■■■■■■■■■■■■■■
0.011 [228487] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.013 [55292] |■■■■■■■
0.016 [32058] |■■■■
0.019 [7509] |■
0.021 [747] |
0.024 [153] |
0.027 [52] |
0.029 [266] |
Latency distribution:
10% in 0.0075 secs
25% in 0.0086 secs
50% in 0.0097 secs
75% in 0.0111 secs
90% in 0.0138 secs
95% in 0.0155 secs
99% in 0.0178 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0034 secs, 0.0019 secs, 0.0043 secs
DNS-lookup: 0.0001 secs, 0.0000 secs, 0.0011 secs
Status code distribution:
[200] 500000 responses
Conclusion
It saves around 27 seconds under high strain conditions. The default configs are at 1 worker and 1 process. You can config for whatever works best for you.
Contributors
Special thanks to @JackThomson2 @messense @awestlake87 for the help with the socket sharing feature! 🥳 ✨