环境: go1.14 gf v1.16.4
使用官方redis示例做压测,发现压测后不能正常连接redis,使用原生的redisgo或者go-redis在gf下压测没用问题,以下是压测的步骤和结果:
` [root@centos7 bin]# curl http://10.11.81.174:9999
v
[root@centos7 bin]# ./wrk -c5000 -d10 -t4 -T3 --latency http://10.11.81.174:9999
Running 10s test @ http://10.11.81.174:9999
4 threads and 5000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 29.48ms 69.41ms 1.65s 97.25%
Req/Sec 30.30k 8.99k 49.88k 66.92%
Latency Distribution
50% 19.17ms
75% 27.67ms
90% 44.97ms
99% 201.93ms
1204337 requests in 10.06s, 248.09MB read
Socket errors: connect 0, read 104, write 4121, timeout 666
Requests/sec: 119763.03
Transfer/sec: 24.67MB
[root@centos7 bin]# curl http://10.11.81.174:9999
write tcp 127.0.0.1:47785->127.0.0.1:6379: use of closed network connection
[root@centos7 bin]# ` 压完访问会提示write tcp 127.0.0.1:47785->127.0.0.1:6379: use of closed network connection
附件是我使用的代码 main.zip