GoBomber is a powerful and flexible API load testing tool written in Go. It allows you to send millions of requests to your API endpoints and collect detailed performance metrics.
- Send up to millions of requests to your API endpoints
- Control concurrency levels
- Set rate limits for requests
- Add custom headers and request bodies
- Get detailed performance metrics
- Export results to JSON for further analysis
GoBomber uses environment variables for configuration. You can set these in a .env
file in the project directory:
# API Load Testing Configuration
# Target URLs (comma-separated)
URLS=http://localhost:8080/api/test
# HTTP Method (GET, POST, PUT, DELETE, etc.)
METHOD=GET
# Request Headers (comma-separated key:value pairs)
HEADERS=Content-Type:application/json,Accept:application/json
# Request Body (for POST, PUT methods)
BODY={"test":"data"}
# Alternatively, use BODY_FILE to specify a file path
# Number of requests to send
NUM_REQUESTS=1000000
# Number of concurrent requests
CONCURRENCY=100
# Request timeout in seconds
TIMEOUT=30
# Rate limit in requests per second (0 = no limit)
RATE_LIMIT=0
# Whether to follow redirects (true/false)
FOLLOW_REDIRECT=true
# Output file for detailed results (JSON format)
OUTPUT_FILE=results.json
# Verbose output (true/false)
VERBOSE=false
- Clone this repository
- Copy the
.env.example
file to.env
- Configure your
.env
file with your API endpoints and test parameters - Run the application:
go run main.go
Or build and run:
go build -o gobomber
./gobomber
To test an API endpoint with 1 million requests:
- Set up your
.env
file:
URLS=https://api.example.com/endpoint
METHOD=GET
NUM_REQUESTS=1000000
CONCURRENCY=100
- Run the application:
go run main.go
The application will display progress during the test and provide a summary of results when complete:
Progress: 1000000/1000000 (100.00%)
All requests completed!
--- Results ---
Total Requests: 1000000
Successful Requests: 998765 (99.88%)
Failed Requests: 1235 (0.12%)
Total Duration: 1m45s
Requests Per Second: 9523.81
Min Response Time: 15ms
Avg Response Time: 42ms
Max Response Time: 350ms
Total Data Received: 45.32 MB
Status Code Distribution:
200: 950123 (95.01%)
201: 48642 (4.86%)
404: 1235 (0.12%)
For more complex scenarios, you can:
- Test multiple endpoints by separating URLs with commas
- Add request bodies from files using the BODY_FILE variable
- Set rate limits to avoid overwhelming your servers
- Export detailed results to JSON for further analysis
MIT