Skip to main content

Performance Targets & SLO Definitions

This document defines Service Level Objectives (SLOs), performance targets, and benchmarks for Aragora.

Service Level Objectives (SLOs)​

Availability​

ServiceTargetMeasurement Window
API Endpoints99.9%Monthly
WebSocket Connections99.5%Monthly
Debate Orchestration99.0%Monthly
Background Jobs98.0%Monthly

Calculation:

Availability = (Total Minutes - Downtime Minutes) / Total Minutes × 100

Latency Targets​

OperationP50P95P99Timeout
Health Check5ms20ms50ms1s
Authentication50ms150ms300ms2s
Simple API Call100ms300ms500ms5s
Debate Start500ms1.5s3s10s
Debate Round2s5s10s30s
Full Debate30s60s120s300s
Search/Query200ms500ms1s5s
Export (small)500ms2s5s30s
Export (large)5s15s30s120s

Throughput Targets​

MetricTargetBurst Capacity
API Requests/sec1,0005,000
WebSocket Connections10,00025,000
Concurrent Debates100500
Messages/sec (streaming)5,00020,000

Error Rate Targets​

CategoryTargetAlert Threshold
5xx Errors< 0.1%> 0.5%
4xx Errors< 5%> 10%
Timeout Errors< 0.5%> 2%
Connection Errors< 0.1%> 1%

Resource Utilization Targets​

Compute Resources​

ResourceNormalWarningCritical
CPU Usage< 60%> 75%> 90%
Memory Usage< 70%> 80%> 95%
Disk I/O< 50%> 70%> 90%
Network I/O< 60%> 80%> 95%

Database Performance​

MetricTargetAlert Threshold
Query Time (P95)< 100ms> 500ms
Connection Pool Usage< 70%> 90%
Replication Lag< 1s> 5s
Cache Hit Ratio> 90%< 80%

Redis Performance​

MetricTargetAlert Threshold
Command Latency (P99)< 5ms> 20ms
Memory Usage< 80%> 90%
Connected Clients< 1000> 5000
Eviction Rate0> 100/s

Performance Benchmarks​

API Endpoint Benchmarks​

# Run API benchmarks
python scripts/benchmark_api.py --endpoint /api/health --requests 10000
python scripts/benchmark_api.py --endpoint /api/debates --requests 1000

Expected Results:

EndpointRPSP50P99
GET /api/health50002ms10ms
GET /api/debates50050ms200ms
POST /api/debates100500ms2s
GET /api/consensus300100ms400ms
GET /api/leaderboard200150ms500ms

Debate Orchestration Benchmarks​

# Run debate benchmarks
python scripts/benchmark_debate.py --rounds 3 --agents 4 --iterations 10

Expected Results:

ConfigurationAvg TimeP95 TimeSuccess Rate
3 rounds, 4 agents45s75s99%
5 rounds, 4 agents75s120s98%
3 rounds, 8 agents90s150s97%
5 rounds, 8 agents150s240s95%

WebSocket Benchmarks​

# Run WebSocket benchmarks
python tests/load/websocket_load.py --connections 1000 --duration 60

Expected Results:

ConnectionsMessage RateLatency P99Memory/Conn
1001000 msg/s50ms50KB
10005000 msg/s100ms45KB
500010000 msg/s200ms40KB
1000015000 msg/s500ms35KB

Capacity Planning​

Scaling Thresholds​

MetricScale UpScale DownCooldown
CPU > 70%+2 podsCPU < 30%5 min
Memory > 80%+2 podsMemory < 40%5 min
RPS > 800+1 podRPS < 40010 min
Queue Depth > 100+2 podsQueue < 205 min

Resource Requirements​

ComponentMin CPUMin MemoryRecommended CPURecommended Memory
API Server0.5512MB22GB
Worker0.25256MB11GB
Redis0.51GB24GB
PostgreSQL12GB48GB

Traffic Projections​

User CountAPI RPSWS ConnectionsDebates/hourInfrastructure
10050100102 pods
1,000300500504 pods
10,0001,5003,00020010 pods
100,0005,00015,00050025 pods

Performance Monitoring​

Key Metrics Dashboard​

# Grafana dashboard panels
panels:
- title: Request Latency (P99)
query: histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))

- title: Error Rate
query: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))

- title: Active Debates
query: aragora_active_debates

- title: WebSocket Connections
query: aragora_websocket_connections

- title: Agent Response Time
query: histogram_quantile(0.95, rate(agent_response_duration_seconds_bucket[5m]))

Alert Rules​

# Prometheus alert rules
groups:
- name: performance
rules:
- alert: HighLatency
expr: histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m])) > 0.5
for: 5m
labels:
severity: warning
annotations:
summary: "High API latency detected"

- alert: HighErrorRate
expr: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) > 0.01
for: 5m
labels:
severity: critical
annotations:
summary: "Error rate exceeds 1%"

- alert: DebateTimeout
expr: rate(debate_timeouts_total[5m]) > 0.1
for: 5m
labels:
severity: warning
annotations:
summary: "Debate timeouts increasing"

Performance Testing​

Load Test Suite​

# Run full load test suite
pytest tests/load/ -v --tb=short

# Specific tests
pytest tests/load/test_concurrent_debates.py -v
pytest tests/load/gauntlet_load.py -v
pytest tests/load/websocket_load.py -v

Stress Test Procedure​

  1. Baseline Measurement

    python scripts/benchmark_api.py --baseline
  2. Gradual Load Increase

    for load in 100 500 1000 2000 5000; do
    python scripts/load_test.py --rps $load --duration 60
    sleep 30
    done
  3. Spike Test

    python scripts/load_test.py --spike --peak-rps 10000 --duration 30
  4. Endurance Test

    python scripts/load_test.py --rps 500 --duration 3600

Results Documentation​

After each load test, document:

  • Test configuration
  • Peak metrics achieved
  • Bottlenecks identified
  • Recommendations

Performance Optimization Checklist​

Application Level​

  • Enable response caching for static data
  • Use connection pooling for databases
  • Implement request batching where applicable
  • Enable gzip compression
  • Use async I/O for external calls

Database Level​

  • Index optimization (explain analyze)
  • Query optimization (N+1 prevention)
  • Connection pool tuning
  • Read replica utilization
  • Cache frequently accessed data

Infrastructure Level​

  • Horizontal pod autoscaling configured
  • Resource requests/limits set
  • CDN for static assets
  • Redis cluster for high availability
  • Database connection pooler (PgBouncer)

Performance Review Schedule​

Review TypeFrequencyParticipants
Metrics ReviewDailyOn-call engineer
Trend AnalysisWeeklyEngineering team
Capacity PlanningMonthlyEngineering + Ops
Load TestingQuarterlyFull team
Architecture ReviewAnnuallyEngineering leads