Benchmark
Local Setup
The AI Gateway has been tested under high load conditions to ensure optimal performance. This guide explains how to run benchmarks and interpret the results.
Running Benchmarks
There are two methods to benchmark the gateway:
1. Automated Benchmark Script
Use our automated benchmark script for comprehensive testing:
The script automatically:
- Verifies dependencies
- Creates a test gateway
- Configures forwarding rules
- Executes multiple benchmark scenarios
Configuration
Customize the benchmark using environment variables:
2. Manual Testing
For custom benchmarks, use hey:
- Install hey:
- Run custom benchmarks:
Performance Results
Recent benchmark results show impressive performance:
Key Metrics
Metric | Value | Description |
---|---|---|
Throughput | 25,500 req/s | Requests processed per second |
Avg Latency | 7.8ms | Average response time |
P99 Latency | 15.8ms | 99th percentile response time |
Success Rate | 100% | Percentage of successful requests |
Performance Characteristics
The gateway demonstrates:
- Low Latency: 90% of requests complete under 11ms
- High Throughput: Exceeds 25k requests per second
- Stability: Minimal performance variance
- Reliability: No failed requests during testing
Notes
- Results were obtained in controlled conditions
- Actual performance may vary based on:
- Network conditions
- Hardware specifications
- Specific use cases
- Load patterns
Best Practices
-
Environment Setup
- Use production-grade hardware
- Ensure sufficient network bandwidth
- Configure appropriate system limits
-
Test Configuration
- Start with lower concurrency
- Gradually increase load
- Monitor system resources
-
Results Analysis
- Focus on P95 and P99 latencies
- Monitor error rates
- Check resource utilization