Comprehensive load testing tools and scenarios for ProxyND Enterprise API endpoints.
# Quick validation (10s, 10 concurrent)
./scripts/loadtest/load-test-enterprise.sh quick
# Standard load test (60s, 100 concurrent)
./scripts/loadtest/load-test-enterprise.sh standard
# Stress test (60s, 500 concurrent)
./scripts/loadtest/load-test-enterprise.sh stress# Single endpoint test
go run scripts/loadtest/loadtest.go \
-url http://localhost:8080/api/v1/enterprise/analytics/overview \
-duration 30s \
-concurrency 50
# With authentication
go run scripts/loadtest/loadtest.go \
-url http://localhost:8080/api/v1/enterprise/rbac/roles \
-duration 60s \
-concurrency 100 \
-token "your-enterprise-token"# Basic test
wrk -t4 -c100 -d30s http://localhost:8080/api/v1/enterprise/analytics/overview
# With authentication
wrk -t4 -c100 -d30s \
-H "Authorization: Bearer your-token" \
http://localhost:8080/api/v1/enterprise/rbac/roles
# Using Lua scenarios
ENTERPRISE_TOKEN="your-token" wrk -t4 -c100 -d60s \
-s scripts/loadtest/wrk-scenarios/enterprise-mixed.lua \
http://localhost:8080Ubuntu/Debian:
sudo apt-get update
sudo apt-get install wrkmacOS:
brew install wrkFrom Source:
git clone https://github.com/wg/wrk.git
cd wrk
make
sudo cp wrk /usr/local/bin/The Go-based load tester requires no installation - it uses Go's standard library.
Purpose: Fast sanity check Duration: 10 seconds Concurrency: 10 users Use Case: CI/CD pipeline, quick verification
./scripts/loadtest/load-test-enterprise.sh quickPurpose: Realistic production load Duration: 60 seconds Concurrency: 100 users Use Case: Regular performance validation
./scripts/loadtest/load-test-enterprise.sh standardPurpose: Find breaking points Duration: 60 seconds Concurrency: 500 users Use Case: Capacity planning
./scripts/loadtest/load-test-enterprise.sh stressPurpose: Gradual load increase Duration: 120 seconds Concurrency: 10 → 1000 users (gradual) Use Case: Test auto-scaling behavior
./scripts/loadtest/load-test-enterprise.sh ramp-upPurpose: Long-running stability Duration: 300 seconds (5 minutes) Concurrency: 100 users Use Case: Memory leak detection, stability verification
./scripts/loadtest/load-test-enterprise.sh sustainedSimulates realistic traffic distribution across all Enterprise endpoints:
- Analytics: 30%
- Audit: 25%
- RBAC: 20%
- Security: 15%
- Alerts: 5%
- License: 5%
ENTERPRISE_TOKEN="your-token" wrk -t4 -c100 -d60s \
-s scripts/loadtest/wrk-scenarios/enterprise-mixed.lua \
http://localhost:8080Tests RBAC management operations:
- List roles (40%)
- Get role details (20%)
- List permissions (20%)
- Get user roles (15%)
- Create role (5%)
ENTERPRISE_TOKEN="your-token" wrk -t4 -c50 -d30s \
-s scripts/loadtest/wrk-scenarios/rbac-operations.lua \
http://localhost:8080Tests audit logging and search performance with various query patterns.
ENTERPRISE_TOKEN="your-token" wrk -t4 -c100 -d60s \
-s scripts/loadtest/wrk-scenarios/audit-search.lua \
http://localhost:8080Simulates dashboard loading by cycling through all analytics endpoints.
ENTERPRISE_TOKEN="your-token" wrk -t4 -c50 -d30s \
-s scripts/loadtest/wrk-scenarios/analytics-dashboard.lua \
http://localhost:8080GET /api/v1/enterprise/rbac/rolesPOST /api/v1/enterprise/rbac/rolesGET /api/v1/enterprise/rbac/roles/{id}PUT /api/v1/enterprise/rbac/roles/{id}DELETE /api/v1/enterprise/rbac/roles/{id}- And 7 more...
GET /api/v1/enterprise/audit/eventsGET /api/v1/enterprise/audit/events/searchGET /api/v1/enterprise/audit/events/{id}POST /api/v1/enterprise/audit/export- And 4 more...
GET /api/v1/enterprise/analytics/overviewGET /api/v1/enterprise/analytics/usageGET /api/v1/enterprise/analytics/performanceGET /api/v1/enterprise/analytics/cache-efficiency- And 6 more...
GET /api/v1/enterprise/security/vulnerabilitiesPOST /api/v1/enterprise/security/scanGET /api/v1/enterprise/security/scan/{jobId}- And 5 more...
GET /api/v1/enterprise/alertsGET /api/v1/enterprise/alerts/{id}POST /api/v1/enterprise/alerts/rules- And 2 more...
GET /api/v1/enterprise/license/infoPOST /api/v1/enterprise/license/validateGET /api/v1/enterprise/license/featuresGET /api/v1/enterprise/license/usage
| Percentile | Target | Acceptable | Poor |
|---|---|---|---|
| p50 | < 50ms | < 100ms | > 200ms |
| p95 | < 200ms | < 500ms | > 1s |
| p99 | < 500ms | < 1s | > 2s |
| Scenario | Target | Acceptable |
|---|---|---|
| Single EP | > 1000 rps | > 500 rps |
| Mixed | > 800 rps | > 400 rps |
| Dashboard | > 500 rps | > 250 rps |
- Target: < 0.1%
- Acceptable: < 1%
- Critical: > 5% (requires investigation)
# Watch Prometheus metrics
watch -n 1 curl -s http://localhost:8080/metrics | grep enterprise_api
# Monitor cache hit rates
watch -n 1 curl -s http://localhost:8080/metrics | grep cache_hit
# Check rate limiting
watch -n 1 curl -s http://localhost:8080/metrics | grep rate_limit# Follow application logs
tail -f logs/proxynd.log | grep enterprise
# Watch for errors
tail -f logs/proxynd.log | grep -i error# CPU and Memory
top -p $(pgrep proxynd)
# Network connections
netstat -an | grep :8080 | wc -l
# Open files
lsof -p $(pgrep proxynd) | wc -l# Analytics overview
go run scripts/loadtest/loadtest.go \
-url http://localhost:8080/api/v1/enterprise/analytics/overview \
-duration 30s \
-concurrency 100
# RBAC roles with pagination
go run scripts/loadtest/loadtest.go \
-url "http://localhost:8080/api/v1/enterprise/rbac/roles?page=1&per_page=50" \
-duration 60s \
-concurrency 50# Set defaults via environment
export BASE_URL=http://localhost:8080
export DURATION=120s
export CONCURRENCY=200
export ENTERPRISE_TOKEN=your-token-here
# Run with env vars
./scripts/loadtest/load-test-enterprise.sh standard# Low concurrency (development)
./scripts/loadtest/load-test-enterprise.sh -c 10 -d 30s
# High concurrency (production simulation)
./scripts/loadtest/load-test-enterprise.sh -c 1000 -d 60sLoad Test Results
=================
Requests:
Total: 12450
Success: 12450 (100.00%)
Failed: 0 (0.00%)
Throughput:
Requests/sec: 415.00
Latency:
Min: 12ms
Avg: 24ms
P50: 22ms
P95: 45ms
P99: 78ms
Max: 156ms
Status Codes:
200: 12450
Performance Verdict:
✓ EXCELLENT: Low latency (<24ms) and high throughput (415 rps)
✓ No errors detected
Good Performance:
- ✓ P95 latency < 200ms
- ✓ Throughput > 500 rps
- ✓ Error rate < 0.1%
- ✓ Consistent latency distribution
Warning Signs:
- ⚠ P95 latency > 500ms
- ⚠ Error rate > 1%
- ⚠ Increasing latency over time (memory leak?)
- ⚠ High variance in latency
Critical Issues:
- ✗ P95 latency > 1s
- ✗ Error rate > 5%
- ✗ Throughput degradation
- ✗ Server crashes or timeouts
- Check cache hit rates: Low cache hits = slower responses
- Database queries: Use query profiling
- Network: Check for network congestion
- CPU usage: May need more resources
- Check logs:
tail -f logs/proxynd.log | grep -i error - Rate limiting: Verify rate limit settings
- Resources: Check CPU, memory, file descriptors
- Upstream issues: Verify upstream services are healthy
- Warm up: Run a small test first to warm caches
- Background processes: Ensure no other heavy processes running
- Network: Use localhost for consistent results
- GC pauses: Monitor Go garbage collection
- name: Load Test
run: |
make dev-run &
sleep 5
./scripts/loadtest/load-test-enterprise.sh quick# Save baseline
./scripts/loadtest/load-test-enterprise.sh standard > baseline.txt
# Compare with current
./scripts/loadtest/load-test-enterprise.sh standard > current.txt
diff baseline.txt current.txtFor questions or issues:
- GitHub Issues: https://github.com/ScriptonBasestar/proxynd/issues
- Email: support@proxynd.io