goreplay使用


 最新版的發布公告:https://leonsbox.com/goreplay-v0-16-and-4th-anniversary-5408b1fd72e0

 主要提到:中間件、報文解壓、從kafka讀取數據、把數據寫到kafka

 開發語音:go,因此需要go語言環境,下載地址 https://golang.org/,mac安裝 https://golang.org/doc/install?download=go1.9.1.darwin-amd64.pkg,linux安裝 https://golang.org/doc/install?download=go1.9.1.linux-amd64.tar.gz

 gorepaly的mac安裝:下載壓縮包后解壓后,是一個名字為goreplay的二機制文件,直接扔進/usr/bin/目錄里,就可以使用了

 唯一依賴:libpcap, https://github.com/buger/goreplay/wiki/Compilation

 主要功能:回放真實http流量

 是否免費:有可以免費的功能,專業版需要收費

 文檔地址:https://github.com/buger/goreplay/wiki

 下載地址:https://github.com/buger/goreplay/releases,linux和mac可以直接安裝使用,也可以自編譯 https://github.com/buger/goreplay/wiki/Compilation

 三大收費功能:support for binary protocols like Thrift or ProtocolBuffers, saving and replaying from cloud storage, TCP sessions replication, etc

基本工作原理:gorelplay在生產環境監聽真實流量,生成文件用於回放,或者直接把這些真實流量轉發到目標服務

goreplay可以啟動一個簡單的web服務器:goreplay file-server :8000,瀏覽器本地訪問,可以看到啟動命令行的目錄文件,可以本地啟動多個端口,進行測試goreplay的各個功能

goreplay的幾個問題:https://github.com/buger/goreplay/wiki/FAQ  https://github.com/buger/goreplay/wiki/Troubleshooting

1、回放會話問題

2、如何截取https流量

3、如何以非root帳號運行 https://github.com/buger/goreplay/wiki/Running-as-non-root-user

4、使用output-http時,http請求的大小有沒有限制?

 

 

舉例:

1、輸出兩份相同流量

goreplay --input-tcp :28020 --output-http "http://staging.com"  --output-http "http://dev.com"

 2、一份流量平均分配到兩個目標網站

goreplay --input-raw :80 --output-http "http://staging.com"  --output-http "http://dev.com" --split-output true

3、 默認goreplay不記錄響應信息,可以通過--input-raw-track-response開啟

4、可以讀取kafka的流量,把流量輸出到kafka

5、可以把流量輸出倒ElasticSearch

6、可以使用中間件,對發出goreplay的報文進行處理

 

 

goreplay並沒有系統性能分析情況,它只負責發數據,被測應用性能情況,需要用戶自己統計

參考:

1、https://goreplay.org

2、https://github.com/buger/goreplay

3、https://github.com/buger/goreplay/wiki

4、https://leonsbox.com/goreplay-v0-16-and-4th-anniversary-5408b1fd72e0

5、https://mp.weixin.qq.com/s?__biz=MzA4Nzc4MjI4MQ%3D%3D&mid=2652402185&idx=1&sn=845546cee445fbf359e69a3ccb3e22c5&scene=0##


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM