流量拷贝工具,你用过那几个?
在进行灰度又或者进行压测(或者放大倍率)的时候,咱们可能会选择流量拷贝的方案来佐证咱们架构设计的可行性和可用性,关于流量拷贝这块,可能你们听到的额最多的是老牌工具tcpcopy, 除此以外还有goreplay, sharingan,下面咱们挨个简单介绍下(只是介绍),具体的使用仍是要参考官方文档。git
流量拷贝的工具
•tcpcopy•goreplay•sharingangithub
tcpcopy
An online request replication tool, also a tcp stream replay tool, fit for real testing, performance testing, stability testing, stress testing, load testing, smoke testing, etcgolang
支持实时数据流复制,同时也支持TCP流量复制,适用于性能测试,压力测试,冒烟测试场景的开源工具。api
tcpcopy[1]微信
•3.6k star•基于c语言网络

goreplay
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.session
GoReplay是一个开源工具,用于捕获实时HTTP流量并将其重放到测试环境中,以便使用真实数据持续测试系统。架构
GoReplay不是代理,而是监听网络接口上的流量,不须要更改生产基础架构,而是在与服务相同的计算机上运行GoReplay守护程序。app
goreplay[2]tcp
•12.9k star•基于Go语言


sharingan
Sharingan(写轮眼)是一个基于golang的流量录制回放工具,适合项目重构、回归测试等。
sharingan[3]
•滴滴出品•212 star•基于Go语言

周边工具
Diffy + Goreplay使用[4]
Test Your APIs on Actual traffic with GoReplay[5]
后记
在大的feature更新或者重构的的时候,若是咱们没有十足的把握直接上到生产,这个时候上面列的工具就能够派上用场了,进行灰度 + 扩大倍率的压测就能作到心中有底,咱们使用过goreplay, 选择他的缘由是tcpcopy稍微有点重,至于sharingan的话,暂时尚未用过,由于刚出来没多久,不过看其官方文档描述,是比goreplay在下游实现方案更优雅,有机会能够玩一玩。
欢迎关注个人公众号“追马Linux”,原创技术文章第一时间推送。

引用连接
[1]
tcpcopy: https://github.com/session-replay-tools/tcpcopy[2]
goreplay: https://github.com/buger/goreplay[3]
sharingan: https://github.com/didi/sharingan[4]
Diffy + Goreplay使用: http://xifxiong.online/goreplay/[5]
Test Your APIs on Actual traffic with GoReplay: https://medium.com/@reshadat/test-your-apis-on-actual-traffic-with-goreplay-88810fbe6d1d
本文分享自微信公众号 - 追马Linux(zhuima_k8s)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。