You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run tcp_bench.go --help
Usage of tcp_bench:
-a="127.0.0.1:12345": target echo server address
-c=50: test connection number
-l=26: test message length
-t=10: test duration in seconds
tcp_echo_normal.go
go run echo_normal.go -l=1024
$ go run tcp_bench.go -c=10 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
10 clients, running 26 bytes, 60 sec.
Speed: 26877 request/sec, 26877 response/sec
Requests: 1612629
Responses: 1612629
$ go run tcp_bench.go -c=20 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
20 clients, running 26 bytes, 60 sec.
Speed: 18228 request/sec, 18228 response/sec
Requests: 1093684
Responses: 1093684
$ go run tcp_bench.go -c=40 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
40 clients, running 26 bytes, 60 sec.
Speed: 25877 request/sec, 25877 response/sec
Requests: 1552643
Responses: 1552643
$ go run tcp_bench.go -c=100 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
100 clients, running 26 bytes, 60 sec.
Speed: 55433 request/sec, 55433 response/sec
Requests: 3326031
Responses: 3326031
$ go run tcp_bench.go -c=500 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
500 clients, running 26 bytes, 60 sec.
Speed: 57955 request/sec, 57955 response/sec
Requests: 3477353
Responses: 3477353
$ go run tcp_bench.go -c=1000 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
1000 clients, running 26 bytes, 60 sec.
Speed: 56076 request/sec, 56076 response/sec
Requests: 3364574
Responses: 3364574
tcp_echo_normal.go (GOMAXPROCS=8)
GOMAXPROCS=8 go run echo_normal.go
$ GOMAXPROCS=8 go run tcp_bench.go -c=10 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
10 clients, running 26 bytes, 60 sec.
Speed: 25214 request/sec, 25214 response/sec
Requests: 1512856
Responses: 1512856
$ GOMAXPROCS=8 go run tcp_bench.go -c=20 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
20 clients, running 26 bytes, 60 sec.
Speed: 28401 request/sec, 28401 response/sec
Requests: 1704098
Responses: 1704096
$ GOMAXPROCS=8 go run tcp_bench.go -c=40 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
40 clients, running 26 bytes, 60 sec.
Speed: 60497 request/sec, 60497 response/sec
Requests: 3629876
Responses: 3629876
$ GOMAXPROCS=8 go run tcp_bench.go -c=100 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
100 clients, running 26 bytes, 60 sec.
Speed: 60657 request/sec, 60657 response/sec
Requests: 3639421
Responses: 3639421
$ GOMAXPROCS=8 go run tcp_bench.go -c=400 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
400 clients, running 26 bytes, 60 sec.
Speed: 60674 request/sec, 60674 response/sec
Requests: 3640498
Responses: 3640498
$ GOMAXPROCS=8 go run tcp_bench.go -c=1000 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
1000 clients, running 26 bytes, 60 sec.
Speed: 60537 request/sec, 60537 response/sec
Requests: 3632244
Responses: 3632244
tcp_echo_normal.js
$ go run tcp_bench.go -c=10 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
10 clients, running 26 bytes, 60 sec.
Speed: 9242 request/sec, 9242 response/sec
Requests: 554549
Responses: 554549
$ go run tcp_bench.go -c=20 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
20 clients, running 26 bytes, 60 sec.
Speed: 15264 request/sec, 15264 response/sec
Requests: 915883
Responses: 915883
$ go run tcp_bench.go -c=40 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
40 clients, running 26 bytes, 60 sec.
Speed: 25285 request/sec, 25285 response/sec
Requests: 1517118
Responses: 1517117
$ go run tcp_bench.go -c=100 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
100 clients, running 26 bytes, 60 sec.
Speed: 26515 request/sec, 26515 response/sec
Requests: 1590943
Responses: 1590943
$ go run tcp_bench.go -c=400 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
400 clients, running 26 bytes, 60 sec.
Speed: 26453 request/sec, 26453 response/sec
Requests: 1587205
Responses: 1587205
$ go run tcp_bench.go -c=1000 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
1000 clients, running 26 bytes, 60 sec.
Speed: 24021 request/sec, 24021 response/sec
Requests: 1441292
Responses: 1441292
tcp_echo_cluster.js
$ GOMAXPROCS=8 go run tcp_bench.go -c=10 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
10 clients, running 26 bytes, 60 sec.
Speed: 19301 request/sec, 19301 response/sec
Requests: 1158096
Responses: 1158096
$ GOMAXPROCS=8 go run tcp_bench.go -c=20 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
20 clients, running 26 bytes, 60 sec.
Speed: 31164 request/sec, 31164 response/sec
Requests: 1869854
Responses: 1869854
$ GOMAXPROCS=8 go run tcp_bench.go -c=40 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
40 clients, running 26 bytes, 60 sec.
Speed: 41640 request/sec, 41640 response/sec
Requests: 2498410
Responses: 2498409
$ GOMAXPROCS=8 go run tcp_bench.go -c=100 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
100 clients, running 26 bytes, 60 sec.
Speed: 60471 request/sec, 60471 response/sec
Requests: 3628299
Responses: 3628299
$ GOMAXPROCS=8 go run tcp_bench.go -c=400 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
400 clients, running 26 bytes, 60 sec.
Speed: 60669 request/sec, 60669 response/sec
Requests: 3640189
Responses: 3640189
$ GOMAXPROCS=8 go run tcp_bench.go -c=1000 -t=60 -a=192.168.1.121:12345
Benchmarking: 192.168.1.121:12345
1000 clients, running 26 bytes, 60 sec.
Speed: 60674 request/sec, 60674 response/sec
Requests: 3640448
Responses: 3640448
给你32个赞