go

go 性能调优工具

2018-05-10  本文已影响0人  站长_郭生

1 压测 http请求:

https://github.com/wg/wrk

例子 

wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html

Running 30s test @ http://127.0.0.1:8080/index.html

  12 threads and 400 connections

  Thread Stats  Avg      Stdev    Max  +/- Stdev

    Latency  635.91us    0.89ms  12.92ms  93.69%

    Req/Sec    56.20k    8.07k  62.00k    86.54%

  22464657 requests in 30.00s, 17.76GB read

Requests/sec: 748868.53

Transfer/sec:    606.33MB

2 go tool pprof 

3 go-torch 火焰图: 更清楚的看到哪个方法调用耗时长

https://github.com/uber/go-torch

上一篇下一篇

猜你喜欢

热点阅读