Support for multi server configuration? #1239
-
This looks like a great project. In our app we have a web server, sql server, elastic search server and so on. Calls are made directly to these servers, in some cases. Would there be anyway to set this up on multiple servers then replay that traffic? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
🤖 Hey @ryanrockwood, great to see you back! Ready to dive into some more GoReplay magic? Sure, you can definitely set up GoReplay on multiple servers and replay the traffic. Here's how you can achieve this:
sudo gor --input-raw :80 --output-http http://staging.com
gor --input-tcp :28020 --output-http "http://staging.com" --output-http "http://dev.com"
gor --input-raw :80 --output-http "http://staging.com" --output-http "http://dev.com" --split-output true
gor --input-raw :80 --input-raw-track-response --output-http "http://staging.com"
gor --input-raw :80 --input-raw-realip-header "X-Real-IP" --output-http "http://staging.com" Remember that GoReplay requires root permissions to analyze network traffic, so you may need to run it with For handling traffic capturing and replaying on multiple servers simultaneously, you can run the GoReplay command on each server where you want to capture traffic. For example, you can run the following command on each web machine: sudo gor --input-raw :80 --output-http http://staging.com This command will record and replay traffic from the same machine. If you want to forward the captured traffic to a separate server, you can use the Aggregator-forwarder setup. In this setup, GoReplay on your web machines forward traffic to a GoReplay aggregator instance running on a separate server. You can also forward traffic to multiple endpoints by specifying multiple gor --input-tcp :28020 --output-http "http://staging.com" --output-http "http://dev.com" By default, GoReplay will send the same traffic to all outputs. However, you can equally split the traffic (round-robin) using the gor --input-raw :80 --output-http "http://staging.com" --output-http "http://dev.com" --split-output true Please note that to analyze network traffic, GoReplay needs permissions which are available only to root users. However, it is possible to configure GoReplay to be run for non-root users. For more details, you can refer to the Capturing And Replaying Traffic section in the GoReplay documentation. Sources
|
Beta Was this translation helpful? Give feedback.
-
Thanks so much for this. OK, so I get that ever server could record their traffic independently but that those individual replay's wouldn't replicate the original traffic but merely one component of the original traffic, right? Based on your response I did notice something about an "aggregator" - which sounds like it might be perfect. Could individual servers all send to an aggregator which would accept all inputs simultaneously and log for later replay? Or would you still be in the same situation of trying to restart replay on 6 different files simultaneously? |
Beta Was this translation helpful? Give feedback.
@squigglefest sorry for the late reply!
Essentially when you point GoReplay to the folder with your files, it reads all files in parallel, to ensure that requests recorded from multiple servers will be replayed in the same original order.
Also, dealing with plain files not that easy when you have multiple instances, so in GoReplay PRO there is built-in support for S3 for both recording and replaying https://github.com/buger/goreplay/wiki/%5BPRO%5D-Using-S3-for-storing-and-replaying-traffic
And if you have a very high traffic environemnt and you need to replay it at speed of like 100kRPS or similar, you can have one GoReplay instance deployed as coordination process, and it will control fl…