流量拷貝工具,你用過那幾個?
在進行灰度又或者進行壓測(或者放大倍率)的時候,咱們可能會選擇流量拷貝的方案來佐證咱們架構設計的可行性和可用性,關於流量拷貝這塊,可能你們聽到的額最多的是老牌工具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源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。