benchmarks for implementation of servers which support 1 million connections
Go
1,929
55 commits
updated Apr 15, 2021
inspired by handling 1M websockets connections in Go
goroutines per connectionepollepollmultiple epoll to manage connections in clientmultiple epoll to manage connections in serverprefork style of apache to implement serverReactor pattern to implement multiple event loopsgoroutines per connection server for test throughtputs and latencymultiple epoll servergoroutines per connection servermultiple epoll servergoroutines per connection serverE5-2630 V4 cpus, total 20 cores, 40 logicial cores.tune the linux:
sysctl -w fs.file-max=2000500
sysctl -w fs.nr_open=2000500
sysctl -w net.nf_conntrack_max=2000500
ulimit -n 2000500
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_tw_reuse=1
client sends the next request only when it has received the response. it has not used the pipeline style to test.
| throughputs (tps) | latency | |
|---|---|---|
| goroutine-per-conn | 202830 | 4.9s |
| single epoll(both server and client) | 42495 | 23s |
| single epoll server | 42402 | 0.8s |
| multiple epoll server | 197814 | 0.9s |
| prefork | 444415 | 1.5s |
| workerpool | 190022 | 0.3s |
中文介绍:
1,438 followers · starred Mar 2019
1,648 followers · starred Mar 2024
18 followers · starred Apr 2021
607 followers · starred Mar 2019
benchmarks for implementation of servers which support 1 million connections
Go
1,929
55 commits
updated Apr 15, 2021
inspired by handling 1M websockets connections in Go
goroutines per connectionepollepollmultiple epoll to manage connections in clientmultiple epoll to manage connections in serverprefork style of apache to implement serverReactor pattern to implement multiple event loopsgoroutines per connection server for test throughtputs and latencymultiple epoll servergoroutines per connection servermultiple epoll servergoroutines per connection serverE5-2630 V4 cpus, total 20 cores, 40 logicial cores.tune the linux:
sysctl -w fs.file-max=2000500
sysctl -w fs.nr_open=2000500
sysctl -w net.nf_conntrack_max=2000500
ulimit -n 2000500
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_tw_reuse=1
client sends the next request only when it has received the response. it has not used the pipeline style to test.
| throughputs (tps) | latency | |
|---|---|---|
| goroutine-per-conn | 202830 | 4.9s |
| single epoll(both server and client) | 42495 | 23s |
| single epoll server | 42402 | 0.8s |
| multiple epoll server | 197814 | 0.9s |
| prefork | 444415 | 1.5s |
| workerpool | 190022 | 0.3s |
中文介绍:
1,438 followers · starred Mar 2019
1,648 followers · starred Mar 2024
18 followers · starred Apr 2021
607 followers · starred Mar 2019