A simple and powerful HTTP load testing tool written in Go. Perform concurrent HTTP load tests against any web endpoint with configurable parameters.
- β‘ High Performance: Concurrent request handling with connection pooling
- π― Configurable: Adjustable request count, concurrency levels, timeouts, and overall test timeout
- π Real-time Metrics: Live progress tracking and detailed results
- π Secure: Optional TLS verification with clear warnings for insecure mode
- π Fast: Single binary with no external dependencies
- π» Cross-platform: Works on Windows, macOS, and Linux
- π¦ Request Body Support: Test POST/PUT/PATCH requests with custom JSON bodies
- π Authentication: Basic Auth and Bearer token support
- β Input Validation: Validates URLs, HTTP methods, and parameters
- π Smart Logging: Throttled logging to avoid output spam
# Clone the repository
git clone https://github.com/memran/go-loadtest.git
cd go-loadtest
# Run a basic load test
go run main.go -url https://httpbin.org/get -requests 1000 -concurrency 50
# View all options
go run main.go --helpgo run main.go -url https://httpbin.org/get -requests 100 -concurrency 10go run main.go -url https://api.example.com -requests 10000 -concurrency 100 -timeout 60go run main.go -url https://httpbin.org/post -method POST \
-body '{"name":"test","value":123}' -requests 100 -concurrency 10go run main.go -url https://httpbin.org/basic-auth/user/pass \
-auth-user user -auth-pass pass -requests 50 -concurrency 5go run main.go -url https://httpbin.org/bearer \
-bearer-token "your-token-here" -requests 100 -concurrency 10# Stop the entire test after 30 seconds, regardless of pending requests
go run main.go -url https://api.example.com -requests 10000 \
-concurrency 100 -total-timeout 30go run main.go -url https://self-signed.example.com -insecure \
-requests 100 -concurrency 10go run main.go -url https://example.com -keepalive=false -requests 100 -concurrency 10| Option | Description | Default |
|---|---|---|
-url |
URL to test | https://httpbin.org/get |
-requests |
Number of requests | 100 |
-concurrency |
Number of concurrent requests | 10 |
-timeout |
Request timeout in seconds | 30 |
-total-timeout |
Total test timeout in seconds (0 for no timeout) | 0 |
-method |
HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD) | GET |
-body |
Request body (for POST/PUT/PATCH) | `` |
-auth-user |
Username for basic authentication | `` |
-auth-pass |
Password for basic authentication | `` |
-bearer-token |
Bearer token for authentication | `` |
-keepalive |
Use HTTP keep-alive | true |
-insecure |
Skip TLS verification | false |
# Clone the repository
git clone https://github.com/memran/go-loadtest.git
cd go-loadtest
# Build the binary
go build -o loadtest main.go
# Run the built binary
./loadtest -url https://api.example.com -requests 1000- Go 1.19 or higher
π Starting HTTP Load Test
π URL: https://api.example.com
π’ Requests: 1000, Concurrency: 50
β±οΈ Timeout: 30s, Method: GET
β±οΈ Total Test Timeout: 300s
π Progress: 200/1000 (20.0%) - Rate: 100.5 req/sec
π Progress: 400/1000 (40.0%) - Rate: 102.3 req/sec
π Progress: 600/1000 (60.0%) - Rate: 98.7 req/sec
π Progress: 800/1000 (80.0%) - Rate: 101.2 req/sec
π Progress: 1000/1000 (100.0%) - Rate: 99.8 req/sec
============================================================
π LOAD TEST COMPLETED!
============================================================
π URL: https://api.example.com
β±οΈ Total Time: 10.02 seconds
π Total Requests: 1000
β
Successful: 980
β Failed: 20
π Success Rate: 98.00%
π Requests/Second: 99.80
π Concurrency: 50
β‘ Method: GET
π Keep-Alive: true
β±οΈ Total Timeout: 300s
π Insecure: false
============================================================
π Starting HTTP Load Test
π URL: https://httpbin.org/post
π’ Requests: 100, Concurrency: 10
β±οΈ Timeout: 30s, Method: POST
π¦ Body: {"test":"data"}
π Auth: Basic (user)
β
Request 0: Status 200 (1191.80ms)
β
Request 1: Status 200 (793.49ms)
π Progress: 30/100 (30.0%) - Rate: 15.0 req/sec
...
============================================================
π LOAD TEST COMPLETED!
============================================================
π URL: https://httpbin.org/post
β±οΈ Total Time: 6.52 seconds
π Total Requests: 100
β
Successful: 100
β Failed: 0
π Success Rate: 100.00%
π Requests/Second: 15.34
π Concurrency: 10
β‘ Method: POST
π Keep-Alive: true
π Insecure: false
============================================================
The tool validates all inputs before starting the test:
- URL: Must start with
http://orhttps:// - HTTP Method: Only allows GET, POST, PUT, DELETE, PATCH, HEAD
- Requests/Concurrency/Timeout: Must be positive integers
- Total Timeout: Must be non-negative
- Body: Cannot be used with GET, HEAD, or DELETE methods
- Authentication: Cannot use both Basic Auth and Bearer Token simultaneously
Important: When using the -insecure flag, be aware that you're bypassing TLS certificate validation. Only use this option in trusted development environments. Never use it for production traffic or with sensitive data.
The tool uses smart logging to avoid output spam:
- First 10 requests (success or failure) are always logged
- Successful requests: logged every 100th request after the first 10
- Failed requests (non-2xx): logged every 50th request
- Network errors: logged every 100th error
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project uses GitHub Actions for automated cross-platform releases.
To create a release:
-
Tag your commit with a version number:
git tag v1.0.0
-
Push the tag to GitHub:
git push origin v1.0.0
-
GitHub Actions will automatically:
- Build binaries for Linux (amd64, arm64), macOS (Intel, Apple Silicon), and Windows (amd64, 386)
- Create a GitHub Release
- Attach all binaries to the release
Linux/macOS:
chmod +x build.sh
./build.sh v1.0.0Windows (PowerShell):
.\build.ps1 -Version "v1.0.0"Binaries will be created in the build/ directory.
Check the version of a built binary:
./go-loadtest --version
# Output: go-loadtest version v1.0.0- Request body support
- Authentication (Basic Auth, Bearer tokens)
- Custom headers
- JSON/CSV output formats
- HTML report generation
- Rate limiting
- More detailed metrics (latency percentiles, throughput graphs)
- Proxy support
- Cookie/session support