goreplay,tcpcopy

流量拷贝工具试用

https://github.com/buger/goreplay
nginx mirror
openresty 通过lua
tcpcopy


支持 HTTP 请求的录制和重放,可以在线上录制请求,在测试环境进行重放。
支持 HTTP 层面的流量过滤,可以只挑选我们感兴趣的流量。
支持请求放大,用于性能测试。

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes. https://goreplay.org


使用过程中遇到的坑。

如果 HTTP 请求不符合规范,可能会抓不到包。遇到过 HTTP 请求头里面的 Content-Length 不等于实际的 Body 大小,goreplay 认为其请求未结束。
input-file 是单 goroutine 在跑,会有性能瓶颈。测试的时候,读取的 RPS 在 1.7w - 1.8w 左右,如果压测需求大于这个,需要开多个进程同时跑。

猜你喜欢

转载自www.cnblogs.com/SZLLQ2000/p/10255910.html