This is a simple load generator that sends HTTP requests at specified intervals to a given URL. It supports concurrency and rate control to simulate different levels of traffic load.
- Sends GET requests to a specified URL
- Controls request rate (requests per second)
- Supports concurrent requests
- Runs for a specified duration
- Handles request failures gracefully
- Python 3.x
- Go 1.x
- Java 8+
- C compiler (GCC or Clang)
- Rust (Cargo)
requestspackage (for Python)libcurl(for C implementation)
Install the required dependencies using:
pip install requestsCompile the Go version:
go build load_generator.goCompile the Java version:
javac LoadGenerator.javaCompile the C version:
gcc load_generator.c -o load_generator -lcurl -pthreadBuild the Rust version:
cargo build --releaseRun the script using the following command:
python load_generator.py --url <TARGET_URL> --rate <REQUESTS_PER_SECOND> --duration <DURATION_IN_SECONDS> --concurrency <NUMBER_OF_CONCURRENT_REQUESTS>./load_generator --url <TARGET_URL> --rate <REQUESTS_PER_SECOND> --duration <DURATION_IN_SECONDS> --concurrency <NUMBER_OF_CONCURRENT_REQUESTS>java LoadGenerator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>./load_generator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>target/release/load_generator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>--url: The target URL to send requests to (required)--rate: Number of requests per second (default: 1)--duration: Duration of the load test in seconds (default: 10)--concurrency: Number of concurrent requests (default: 5)
This project is open-source and available under the MIT License.
@PramithaMJ