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.
Top Related Projects
Modern HTTP benchmarking tool
HTTP load generator, ApacheBench (ab) replacement
HTTP load testing tool and library. It's over 9000!
Fast cross-platform HTTP benchmarking tool written in Go
Write scalable load tests in plain Python 🚗💨
Quick Overview
GoReplay (gor) is an open-source tool for capturing and replaying HTTP traffic. It can be used for a variety of purposes, such as load testing, debugging, and monitoring web applications. GoReplay is designed to be easy to use and integrate with other tools, making it a versatile tool for developers and operations teams.
Pros
- Real-time traffic capture: GoReplay can capture and replay HTTP traffic in real-time, allowing you to analyze and debug issues as they happen.
- Flexible configuration: GoReplay supports a wide range of configuration options, allowing you to customize its behavior to suit your specific needs.
- Scalable and efficient: GoReplay is designed to be highly scalable and efficient, allowing you to capture and replay large amounts of traffic without impacting the performance of your application.
- Integration with other tools: GoReplay can be integrated with a variety of other tools, such as load testing frameworks and monitoring tools, making it a valuable addition to your toolbox.
Cons
- Limited support for non-HTTP protocols: GoReplay is primarily focused on capturing and replaying HTTP traffic, and may not be as well-suited for capturing and replaying other types of network traffic.
- Complexity of configuration: While GoReplay is designed to be easy to use, the wide range of configuration options can make it challenging to set up, especially for users who are new to the tool.
- Potential performance impact: Depending on the volume of traffic being captured and replayed, GoReplay may have a noticeable impact on the performance of your application.
- Limited community support: While GoReplay has a growing user base, the project may not have the same level of community support and documentation as some other open-source tools.
Code Examples
N/A (this is not a code library)
Getting Started
N/A (this is not a code library)
Competitor Comparisons
Modern HTTP benchmarking tool
Pros of wrk
- Lightweight and efficient, designed for high-performance benchmarking
- Supports Lua scripting for custom request generation and response handling
- Provides detailed performance statistics and latency distribution
Cons of wrk
- Limited to HTTP/HTTPS protocols
- Lacks built-in traffic recording and replay functionality
- Less suitable for complex, multi-step scenarios or API testing
Code Comparison
wrk:
wrk.method = "POST"
wrk.body = '{"key": "value"}'
wrk.headers["Content-Type"] = "application/json"
GoReplay:
gor --input-raw :8000 --output-http "http://localhost:8001"
Key Differences
- Purpose: wrk is primarily a benchmarking tool, while GoReplay focuses on traffic capture and replay
- Functionality: GoReplay offers more versatile traffic manipulation and real-time analysis
- Ease of use: wrk requires scripting for advanced scenarios, GoReplay has a simpler command-line interface
- Protocol support: wrk is limited to HTTP/HTTPS, GoReplay supports various protocols and can work with raw TCP traffic
Both tools serve different purposes in the web development ecosystem. wrk excels at load testing and benchmarking, while GoReplay shines in traffic analysis, debugging, and replication of production environments.
HTTP load generator, ApacheBench (ab) replacement
Pros of hey
- Simpler and more lightweight, focused solely on HTTP load testing
- Easy to use with a straightforward command-line interface
- Provides clear and concise output for quick analysis
Cons of hey
- Limited functionality compared to goreplay's comprehensive traffic recording and replaying capabilities
- Lacks advanced features like request filtering, middleware support, and real-time traffic analysis
Code comparison
hey:
func (b *Work) runWorker(n int) {
for i := 0; i < n; i++ {
b.makeRequest(b.client)
}
}
goreplay:
func (t *TCPMessage) UUID() []byte {
return t.packet.Dump()[t.start:t.start+16]
}
The code snippets demonstrate the different focus areas of the two projects. hey's code is centered around making HTTP requests for load testing, while goreplay's code deals with packet analysis and traffic manipulation.
hey is best suited for quick and simple HTTP load testing scenarios, while goreplay offers a more comprehensive solution for capturing, analyzing, and replaying network traffic. The choice between the two depends on the specific requirements of the project and the depth of traffic analysis needed.
HTTP load testing tool and library. It's over 9000!
Pros of Vegeta
- Designed specifically for HTTP load testing with a focus on high-performance and concurrency
- Provides detailed metrics and reports, including latency distribution and histogram
- Supports multiple output formats (JSON, CSV, Histogram) for easy integration with other tools
Cons of Vegeta
- Limited to HTTP/HTTPS protocols, unlike GoReplay which supports TCP traffic
- Lacks the ability to record and replay real traffic, which GoReplay excels at
- May require more setup and configuration for complex scenarios compared to GoReplay's simpler approach
Code Comparison
Vegeta:
rate := vegeta.Rate{Freq: 100, Per: time.Second}
duration := 5 * time.Second
targeter := vegeta.NewStaticTargeter(vegeta.Target{
Method: "GET",
URL: "http://example.com",
})
attacker := vegeta.NewAttacker()
results := attacker.Attack(targeter, rate, duration, "Example")
GoReplay:
input := gor.NewFileInput("requests.gor")
output := gor.NewHTTPOutput("http://localhost:8000")
limiter := gor.NewLimiter(100)
gor.Run(input, output, limiter)
Both tools offer powerful load testing capabilities, but Vegeta focuses on HTTP-specific performance testing with detailed metrics, while GoReplay excels in recording and replaying real traffic across various protocols.
Fast cross-platform HTTP benchmarking tool written in Go
Pros of Bombardier
- Designed specifically for HTTP(S) load testing and benchmarking
- Supports multiple concurrent connections and precise timing control
- Written in Go, offering good performance and cross-platform compatibility
Cons of Bombardier
- Limited to HTTP(S) protocols, unlike GoReplay's broader traffic capture capabilities
- Lacks GoReplay's ability to record and replay real traffic patterns
- Doesn't offer middleware or plugins for extending functionality
Code Comparison
Bombardier (simple benchmark):
bombardier -c 100 -n 10000 http://example.com
GoReplay (capture and replay):
gor --input-raw :8080 --output-http http://localhost:8081
Key Differences
Bombardier focuses on generating synthetic load for HTTP(S) benchmarking, while GoReplay specializes in capturing and replaying real traffic across various protocols. Bombardier is more suitable for stress testing and performance benchmarking of web applications, whereas GoReplay excels in replicating production traffic patterns for testing and debugging purposes.
Both tools are written in Go, offering good performance and cross-platform support. However, GoReplay provides more flexibility in terms of protocol support and traffic manipulation, making it a more versatile tool for complex testing scenarios. Bombardier, on the other hand, offers a simpler and more focused approach to HTTP load testing.
Write scalable load tests in plain Python 🚗💨
Pros of Locust
- Supports distributed load testing across multiple machines
- Provides a web-based UI for real-time test monitoring and control
- Allows writing test scenarios in Python, offering more flexibility
Cons of Locust
- Requires writing test scripts, which can be more time-consuming
- May have higher resource usage for large-scale tests
- Limited built-in support for capturing and replaying traffic
Code Comparison
Locust example:
from locust import HttpUser, task, between
class WebsiteUser(HttpUser):
wait_time = between(1, 5)
@task
def index_page(self):
self.client.get("/")
GoReplay example:
gor --input-raw :8000 --output-http="http://staging.com"
While Locust requires writing Python scripts to define test scenarios, GoReplay can capture and replay traffic with a simple command-line interface. Locust offers more customization options, but GoReplay excels in ease of use for basic traffic replication.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
https://goreplay.org/
GoReplay is an open-source network monitoring tool which can record your live traffic and use it for shadowing, load testing, monitoring and detailed analysis.
About
As your application grows, the effort required to test it also grows exponentially. GoReplay offers you the simple idea of reusing your existing traffic for testing, which makes it incredibly powerful. Our state of art technique allows you to analyze and record your application traffic without affecting it. This eliminates the risks that come with putting a third party component in the critical path.
GoReplay increases your confidence in code deployments, configuration and infrastructure changes.
GoReplay offers a unique approach for shadowing. Instead of being a proxy, GoReplay listens in the background for traffic on your network interfaces, requiring no changes in your production infrastructure, other than running GoReplay daemon on the same machine as your service.
Check latest documentation.
Installation
Download the latest binary from https://github.com/buger/goreplay/releases or compile by yourself.
Getting started
The most basic setup will be sudo ./gor --input-raw :8000 --output-stdout
which acts like tcpdump.
If you already have a test environment, you can start replaying by running: sudo ./gor --input-raw :8000 --output-http http://staging.env
.
See our documentation and the Getting Started page for more info.
Newsletter
Subscribe to our newsletter to stay informed about the latest features and changes to the Gor project.
Want to Upgrade?
We have created a GoReplay PRO extension which provides additional features such as support for binary protocols like Thrift or ProtocolBuffers, saving and replaying from cloud storage, TCP session replication, etc. The PRO version also includes a commercial-friendly license, dedicated support, and it also allows you to support high-quality open source development.
Problems?
If you have a problem, please review the FAQ and Troubleshooting wiki pages. Searching the issues for your problem is also a good idea.
All bug-reports and suggestions should go through Github Issues or our Google Group (you can just send email to gor-users@googlegroups.com). If you have a private question feel free to send email to support@gortool.com.
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Added some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Companies using Gor
- GOV.UK - UK Government Digital Service
- theguardian.com - Most popular online newspaper in the UK
- TomTom - Global leader in navigation, traffic and map products, GPS Sport Watches and fleet management solutions.
- 3SCALE - API infrastructure to manage your APIs for internal or external users
- Optionlab - Optimize customer experience and drive engagement across multiple channels
- TubeMogul - Software for Brand Advertising
- Videology - Video advertising platform
- ForeksMobile - One of the leading financial application development company in Turkey
- Granify - AI backed SaaS solution that enables online retailers to maximise their sales
- And many more!
If you are using Gor, we are happy to add you to the list and share your story, just write to: hello@goreplay.org
Author
Leonid Bugaev, @buger, https://leonsbox.com
Top Related Projects
Modern HTTP benchmarking tool
HTTP load generator, ApacheBench (ab) replacement
HTTP load testing tool and library. It's over 9000!
Fast cross-platform HTTP benchmarking tool written in Go
Write scalable load tests in plain Python 🚗💨
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot