【Gin框架】为什么我压测Gin框架性能只能达到300qps就开始超时呢

qiran87 · · 24092 次点击
``` ~/codes/apkAdmin(master*) » wrk -c 100 -t 10 -d 10m http://127.0.0.1:1234/bin/search Running 10m test @ http://127.0.0.1:1234/bin/search 10 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 17.98ms 39.48ms 987.19ms 92.64% Req/Sec 1.32k 612.42 3.77k 65.24% 7803730 requests in 10.00m, 0.86GB read Socket errors: connect 0, read 23, write 0, timeout 0 Requests/sec: 13003.68 Transfer/sec: 1.46MB ------------------------------------------------------------ ~/codes/apkAdmin(master*) » wrk -c 100 -t 10 -d 10m http://127.0.0.1:1234/bin/search Running 10m test @ http://127.0.0.1:1234/bin/search 10 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 36.36ms 74.70ms 997.60ms 90.05% Req/Sec 1.09k 726.72 4.70k 58.11% 5881268 requests in 10.00m, 661.84MB read Socket errors: connect 0, read 309, write 0, timeout 0 Requests/sec: 9800.17 Transfer/sec: 1.10MB ------------------------------------------------------------ ~/codes/apkAdmin(master*) » wrk -c 100 -t 10 -d 10m http://127.0.0.1:1234/bin/search Running 10m test @ http://127.0.0.1:1234/bin/search 10 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 68.92ms 125.57ms 996.69ms 87.01% Req/Sec 0.99k 583.94 3.72k 65.28% 4554951 requests in 10.00m, 512.58MB read Socket errors: connect 0, read 328, write 0, timeout 0 Requests/sec: 7590.57 Transfer/sec: 0.85MB ------------------------------------------------------------ ``` 三次压测结果。4核8G Mac. go version go1.8.3 darwin/amd64
#7
更多评论
是不是机器到瓶颈了, 看看机器的cpu使用率. 适当加大cpu试试看.
#1
cpu使用率才到20%,还很小~Gin可以调整使用cpu的个数吗?
#2