A comprehensive framework for load testing and monitoring a distributed hashmap system.
This framework provides tools for:
- Throughput Testing - Measure the system's ability to handle a consistent load
- Stress Testing - Push the system beyond its limits to identify breaking points
- System Monitoring - Track resource usage during tests
- Results Analysis - Generate reports and visualizations from test data
scripts/
├── loadtest/ # Load testing tools
│ ├── loadtest.go # Throughput testing tool
│ ├── stress_test.go # Stress testing tool
│ ├── run_load_test.sh # Script to run load tests
│ └── analyze_results.py # Script to analyze test results
├── monitoring/ # Monitoring tools
│ ├── system_monitor.py # System resource monitoring
│ ├── prometheus.yml # Prometheus configuration
│ ├── docker-compose.monitoring.yml # Monitoring stack
│ └── start_monitoring.sh # Script to start monitoring
└── requirements.txt # Python dependencies
- Go 1.16 or later
- Python 3.6 or later
- Docker and Docker Compose
- The distributed hashmap system running and accessible
-
Clone this repository:
git clone https://github.com/yourusername/distributed-hashmap.git cd distributed-hashmap -
Install Python dependencies:
pip install -r scripts/requirements.txt
-
Make scripts executable:
chmod +x scripts/loadtest/run_load_test.sh chmod +x scripts/monitoring/start_monitoring.sh chmod +x scripts/loadtest/analyze_results.py
cd scripts/monitoring
./start_monitoring.shThis will start:
- Prometheus (http://localhost:9090)
- Grafana (http://localhost:3000)
- Node Exporter (http://localhost:9100/metrics)
- cAdvisor (http://localhost:8080)
cd scripts/loadtest
./run_load_test.sh --test-type throughput --url http://localhost:8080 --duration 300 --threads 20 --rps 5000cd scripts/loadtest
./run_load_test.sh --test-type stress --url http://localhost:8080 --duration 600 --threads 50 --max-keys 500000cd scripts/loadtest
./analyze_results.py --results-dir ./results/throughput_test_20230501_120000To compare with a baseline:
./analyze_results.py --results-dir ./results/throughput_test_20230501_120000 --compare-with ./results/throughput_test_20230430_120000- Configurable request rate (RPS)
- Adjustable read/write ratio
- Customizable key and value sizes
- Real-time metrics reporting
- Progressive key insertion
- Memory usage monitoring
- Goroutine leak detection
- System resource tracking
- CPU, memory, disk, and network usage
- Container-level metrics
- Custom Grafana dashboards
- Prometheus metric collection
- Performance metrics calculation
- Visualization of results
- Comparison with baseline tests
- Detailed reports generation
- Establish Baselines - Run tests against a known good configuration
- Isolate Variables - Change one parameter at a time
- Realistic Data - Use realistic key and value sizes
- Warm-up Period - Allow the system to warm up before measuring
- Repeat Tests - Run tests multiple times for consistency
- Monitor Everything - Collect as much data as possible
- Compare Results - Compare before and after optimizations
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.