Rate Limits Configuration
Overview
Section titled “Overview”NORA implements rate limiting to protect the registry from excessive load. This guide covers default values, tuning guidelines, and monitoring.
Environment Variables
Section titled “Environment Variables”| Variable | Default | Description |
|---|---|---|
NORA_RATE_LIMIT_UPLOAD_RPS | 200 | Upload requests per second |
NORA_RATE_LIMIT_UPLOAD_BURST | 500 | Maximum burst for uploads |
NORA_RATE_LIMIT_GENERAL_RPS | 500 | General requests per second |
NORA_RATE_LIMIT_GENERAL_BURST | 1000 | Maximum burst for general requests |
Configuration Examples
Section titled “Configuration Examples”Docker Run
Section titled “Docker Run”docker run -d \ --name nora \ -p 5000:5000 \ -v /data/nora:/data \ -e NORA_RATE_LIMIT_UPLOAD_RPS=2000 \ -e NORA_RATE_LIMIT_UPLOAD_BURST=5000 \ -e NORA_RATE_LIMIT_GENERAL_RPS=1000 \ -e NORA_RATE_LIMIT_GENERAL_BURST=2000 \ ghcr.io/getnora-io/nora:latest serveDocker Compose
Section titled “Docker Compose”services: nora: image: ghcr.io/getnora-io/nora:latest environment: NORA_RATE_LIMIT_UPLOAD_RPS: 2000 NORA_RATE_LIMIT_UPLOAD_BURST: 5000 NORA_RATE_LIMIT_GENERAL_RPS: 1000 NORA_RATE_LIMIT_GENERAL_BURST: 2000YAML Configuration
Section titled “YAML Configuration”rate_limits: upload: rps: 2000 burst: 5000 general: rps: 1000 burst: 2000Command Line
Section titled “Command Line”nora serve \ --rate-limit-upload-rps 2000 \ --rate-limit-upload-burst 5000 \ --rate-limit-general-rps 1000 \ --rate-limit-general-burst 2000Tuning Guidelines
Section titled “Tuning Guidelines”Small Team (< 10 developers)
Section titled “Small Team (< 10 developers)”Default values are sufficient:
NORA_RATE_LIMIT_UPLOAD_RPS=200NORA_RATE_LIMIT_UPLOAD_BURST=500NORA_RATE_LIMIT_GENERAL_RPS=500NORA_RATE_LIMIT_GENERAL_BURST=1000Use case: Low-frequency builds, manual pushes, small CI/CD pipeline
Medium Team (10-50 developers)
Section titled “Medium Team (10-50 developers)”Moderate increase recommended:
NORA_RATE_LIMIT_UPLOAD_RPS=1000NORA_RATE_LIMIT_UPLOAD_BURST=2000NORA_RATE_LIMIT_GENERAL_RPS=750NORA_RATE_LIMIT_GENERAL_BURST=1500Use case: Regular CI/CD, multiple parallel builds, active development
Large Team (50+ developers, Heavy CI/CD)
Section titled “Large Team (50+ developers, Heavy CI/CD)”Significant increase for high throughput:
NORA_RATE_LIMIT_UPLOAD_RPS=2000NORA_RATE_LIMIT_UPLOAD_BURST=5000NORA_RATE_LIMIT_GENERAL_RPS=1000NORA_RATE_LIMIT_GENERAL_BURST=2000Use case: Continuous deployment, matrix builds, high-frequency pushes
Enterprise / Multi-tenant
Section titled “Enterprise / Multi-tenant”Custom tuning based on load:
NORA_RATE_LIMIT_UPLOAD_RPS=5000NORA_RATE_LIMIT_UPLOAD_BURST=10000NORA_RATE_LIMIT_GENERAL_RPS=2000NORA_RATE_LIMIT_GENERAL_BURST=5000Use case: Multiple teams, 24/7 CI/CD, global deployments
Understanding Rate Limit Parameters
Section titled “Understanding Rate Limit Parameters”RPS (Requests Per Second)
Section titled “RPS (Requests Per Second)”- Definition: Average sustained rate of requests allowed
- Example:
RPS=200means 200 requests per second on average - Effect: Requests exceeding this rate will be rate-limited
- Definition: Maximum spike of requests allowed temporarily
- Example:
BURST=500allows up to 500 requests in a short burst - Effect: Handles traffic spikes without immediate rate limiting
Upload vs General
Section titled “Upload vs General”- Upload limits: Apply to image push operations (PUT, POST to
/v2/) - General limits: Apply to all other operations (pulls, catalog, tags)
Monitoring Rate Limits
Section titled “Monitoring Rate Limits”Metrics Endpoint
Section titled “Metrics Endpoint”Check /metrics for rate limit statistics:
curl http://localhost:4000/metrics | grep rate_limitKey metrics:
nora_rate_limit_hits_total{type="upload"}- Upload rate limit violationsnora_rate_limit_hits_total{type="general"}- General rate limit violationsnora_requests_total- Total requests processed
Prometheus Query
Section titled “Prometheus Query”# Rate limit hit rate over 5 minutesrate(nora_rate_limit_hits_total[5m])
# Percentage of requests rate-limited(rate(nora_rate_limit_hits_total[5m]) / rate(nora_requests_total[5m])) * 100Alert Rules
Section titled “Alert Rules”groups: - name: nora_rate_limits rules: - alert: NoraHighRateLimitHits expr: rate(nora_rate_limit_hits_total[5m]) > 10 for: 5m labels: severity: warning annotations: summary: "NORA experiencing high rate limit violations" description: "{{ $value }} rate limit hits per second"
- alert: NoraRateLimitCritical expr: (rate(nora_rate_limit_hits_total[5m]) / rate(nora_requests_total[5m])) > 0.1 for: 10m labels: severity: critical annotations: summary: "Over 10% of requests are being rate-limited" description: "Consider increasing rate limits"Troubleshooting
Section titled “Troubleshooting”Symptom: “429 Too Many Requests” errors
Section titled “Symptom: “429 Too Many Requests” errors”Cause: Rate limits exceeded
Solution:
- Check current rate limit configuration
- Monitor
/metricsto identify which limit is hit (upload vs general) - Increase appropriate limits based on your workload
- Restart NORA to apply new limits
Symptom: Slow image pushes during CI/CD
Section titled “Symptom: Slow image pushes during CI/CD”Cause: Upload rate limits too restrictive for parallel builds
Solution:
# Increase upload limitsNORA_RATE_LIMIT_UPLOAD_RPS=2000NORA_RATE_LIMIT_UPLOAD_BURST=5000Symptom: API calls timing out
Section titled “Symptom: API calls timing out”Cause: General rate limits blocking metadata requests
Solution:
# Increase general limitsNORA_RATE_LIMIT_GENERAL_RPS=1000NORA_RATE_LIMIT_GENERAL_BURST=2000Best Practices
Section titled “Best Practices”- Start Conservative - Begin with default limits and increase based on metrics
- Monitor Continuously - Set up Prometheus alerts for rate limit hits
- Plan for Spikes - Set
BURSTvalues higher thanRPSto handle traffic spikes - Separate Upload/General - Tune independently based on usage patterns
- Document Changes - Keep track of limit adjustments and reasons
- Load Testing - Test new limits in staging before production
Performance Impact
Section titled “Performance Impact”Rate limiting in NORA is very efficient:
- Overhead: < 1ms per request
- Memory: Negligible (token bucket algorithm)
- CPU: Minimal impact even at high RPS
Increasing limits has virtually no performance penalty on NORA itself. Limits exist purely to protect the server from excessive client load.