Rate Limiting
Protect your backend APIs from abuse, excessive load, and DDoS attacks with KnoxCall’s intelligent rate limiting system.What is Rate Limiting?
Rate limiting controls how many requests a client can make within a specific time window. It prevents:- ❌ API abuse - Malicious users making excessive requests
- ❌ Accidental overload - Buggy code creating infinite loops
- ❌ DDoS attacks - Distributed denial of service attempts
- ❌ Cost overruns - Preventing excessive API usage costs
How Rate Limiting Works
- Per minute: Resets every 60 seconds
- Per hour: Resets every hour
- Per day: Resets at midnight UTC
Configuration Levels
KnoxCall supports rate limiting at multiple levels:1. Route-Level Limits
Apply to all clients using a route:2. Client-Level Limits
Apply to individual clients:3. Method-Specific Limits
Different limits per HTTP method:Setting Up Rate Limits
Route-Level Rate Limiting
- Navigate to Routes → Select your route
- Scroll to Rate Limiting section
- Toggle Enable Rate Limiting to ON
- Configure limits:
minute, hour, day
Burst Allowance (Optional):
- Click Save
Client-Level Rate Limiting
- Navigate to Clients → Select your client
- Scroll to Rate Limiting section
- Configure limits:
Method-Specific Rate Limiting
- Edit your route
- Go to Method Configurations tab
- For each HTTP method, set individual limits:
Rate Limit Response
When a client exceeds the limit, they receive: HTTP Status:Checking Rate Limit Status
Clients can check their current status via response headers on every request:X-RateLimit-Limit: Total requests allowed in windowX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when limit resets
Burst Protection
Handle temporary traffic spikes without blocking legitimate users: Configuration:- Client can make up to 1,200 requests in a short burst
- After burst, limited to 1,000 requests/hour average
- Prevents legitimate spikes from being blocked
Advanced Strategies
Per-User Rate Limiting
Use different limits based on user tiers:Geographic Rate Limiting
Combine with IP whitelisting:Time-Based Rate Limiting
Different limits for peak vs off-peak: Peak Hours (9 AM - 5 PM):- Limit: 500 requests/hour
- Limit: 2,000 requests/hour
This requires creating separate routes or using API-based dynamic configuration.
Rate Limit Monitoring
View Rate Limit Events
- Navigate to Logs → API Logs
- Filter by status code:
429 - See which clients are hitting limits
Set Up Alerts
Get notified when clients hit rate limits:- Navigate to Alerts → Add Alert
- Select Rate Limit Exceeded
- Configure:
Analytics Dashboard
Monitor rate limit metrics:- Hit rate: % of requests that are rate-limited
- Top offenders: Clients hitting limits most often
- Trend analysis: Rate limit violations over time
Best Practices
1. Start Conservative
Begin with strict limits and relax based on usage:2. Use Tiered Limits
Different limits for different client types:3. Enable Burst Protection
Allow temporary spikes:4. Monitor and Adjust
- Check rate limit logs weekly
- Adjust limits based on legitimate usage
- Set alerts for unusual patterns
5. Communicate Limits
Document your rate limits for API consumers:Common Configurations
Webhook Endpoint
Public API
Internal Microservices
Payment Processing
Handling Rate Limits (Client-Side)
Exponential Backoff
When receiving 429, implement retry logic:Check Headers Proactively
Request Queuing
Prevent hitting limits by queuing requests:Troubleshooting
High False Positive Rate
Problem: Legitimate users hitting limits Solutions:- Increase burst allowance
- Raise base limits
- Use per-user instead of per-IP limits
DDoS Still Getting Through
Problem: Rate limits not preventing attacks Solutions:- Lower limits for unknown clients
- Enable request signing
- Use IP-based blocking
- Contact support for enterprise DDoS protection
Inconsistent Limit Enforcement
Problem: Some requests bypass rate limits Check:- Rate limits enabled on all routes
- No conflicting client configurations
- Limits applied at correct level (route vs client)
Next Steps
Request Signing
Add cryptographic signatures for extra security
Alerts
Get notified of rate limit violations
Analytics
Monitor rate limit metrics
Client Management
Set up per-client limits
📊 Statistics
- Level: intermediate
- Time: 15 minutes
🏷️ Tags
rate-limiting, security, ddos, api-protection