ratethrottle

Get Started

  • Installation
    • Basic Installation
    • Installation with Optional Dependencies
      • Redis Storage
      • Flask Integration
      • FastAPI Integration
      • Django Integration
      • All Frameworks
      • GRPC Integration
      • GraphQL Integration
      • Websocket Integration
      • All Protocols
      • All dependencies
    • Development Installation
    • Installing from Source
    • Verifying Installation
    • System Requirements
    • Next Steps
  • Quick Start
    • Simple Rate Limiting
    • Flask Integration
    • FastAPI Integration
    • Using Redis for Distributed Systems
    • Using Different Strategies
    • Whitelist and Blacklist
    • Monitoring and Metrics
    • DDoS Protection
    • Command Line Interface
    • Configuration Files
    • Next Steps
  • Basic Usage
    • Core Concepts
    • Creating a Rate Limiter
      • Quick Creation
      • Manual Creation
    • Defining Rules
      • Basic Rule
      • Rule with Strategy
      • Rule with Scope
      • Rule with Block Duration
    • Checking Rate Limits
      • Basic Check
      • Using Status Object
      • Adding Metadata
    • Managing Rules
      • Add Rules
      • Remove Rules
      • List Rules
      • Get Specific Rule
    • Whitelist and Blacklist
      • Whitelist Management
      • Blacklist Management
    • Violation Callbacks
    • Metrics and Monitoring
      • Get Metrics
      • Reset Metrics
      • System Status
    • Error Handling
      • Handling RateLimitExceeded
    • Using with Context Managers
    • Parsing Rate Limit Strings
    • Best Practices
    • Next Steps

User Guide

  • Core Concepts
    • Rate Limiting Basics
      • What is Rate Limiting?
    • Key Components
      • Rules
      • Storage Backends
      • Limiter Engine
    • Scopes
      • IP Scope
      • User Scope
      • Endpoint Scope
      • Global Scope
    • Rate Limiting Status
      • Attributes
      • Using Status Information
    • Violations
      • Violation Object
      • Violation Callbacks
    • Whitelist and Blacklist
      • Whitelist
      • Blacklist
    • Block Duration
    • Metrics and Monitoring
    • Threading and Concurrency
    • Distributed Systems
    • Best Practices
    • Architecture Diagram
    • Next Steps
  • Rate Limiting Strategies
    • Overview
    • Available Strategies
    • Token Bucket Strategy
      • How It Works
      • Example Behavior
      • Best For
      • Implementation
    • Leaky Bucket Strategy
      • How It Works
      • Example Behavior
      • Best For
      • Implementation
    • Fixed Window Strategy
      • How It Works
      • Example Behavior
      • Boundary Condition Problem
      • Best For
      • Implementation
    • Sliding Window Counter Strategy
      • How It Works
      • Example Behavior
      • Solves Boundary Problem
      • Best For
      • Implementation
      • When to Use vs Other Strategies
    • Sliding Window Strategy
      • How It Works
      • Example Behavior
      • Best For
      • Implementation
    • Strategy Comparison
      • Performance
      • Burst Handling
    • Choosing a Strategy
      • Decision Tree
      • Use Case Matrix
    • Combining Strategies
    • Advanced Configuration
      • Token Bucket Fine-Tuning
    • Testing Strategies
    • Next Steps
  • Storage Backends
    • Available Backends
      • In-Memory Storage
      • Redis Storage
    • In-Memory Storage
      • Usage
      • Configuration
      • When to Use
    • Redis Storage
      • Installation
      • Basic Usage
      • Advanced Configuration
      • Redis Connection Options
        • Connection Pooling
        • SSL/TLS Connection
        • Redis Sentinel
        • Redis Cluster
    • Storage Operations
      • Get
      • Set
      • Increment
      • Delete
      • Exists
      • Clear
    • Performance Considerations
      • In-Memory
      • Redis
      • Optimizing Redis Performance
    • Distributed Systems
      • Architecture
      • Implementation
    • High Availability
      • Redis Sentinel Setup
      • Redis Persistence
    • Custom Storage Backend
    • Monitoring Storage
      • Redis Monitoring
      • Storage Metrics
    • Best Practices
    • Next Steps
  • Configuration
    • Configuration Methods
    • Programmatic Configuration
      • Basic Setup
      • With Storage
    • YAML Configuration
      • Configuration File Format
      • Loading Configuration
    • Environment Variables
      • Variable Naming Convention
      • Setting Environment Variables
      • Supported Environment Variables
        • Storage Configuration
        • Global Configuration
        • DDoS Protection
        • Adaptive Rate Limiting
        • Monitoring
        • Alerting
        • Boolean Values
      • Examples
      • Priority Order
      • Validation
    • Configuration Options
      • Rule Configuration
      • Storage Configuration
      • DDoS Configuration
      • Analytics Configuration
    • Best Practices
    • Example Complete Configuration
    • Next Steps
  • ML Adaptive Limiting
    • Overview
    • Installation
    • Quick Start
      • Basic Usage
    • How It Works
      • 1. Pattern Learning
      • 2. Anomaly Detection
      • 3. Trust Scoring
      • 4. Limit Adjustment
    • Configuration
      • Basic Configuration
      • Advanced Configuration
      • Configuration Guidelines
    • Use Cases
      • 1. Public API Protection
      • 2. SaaS Application
      • 3. E-commerce Checkout
      • 4. Internal API Gateway
    • Monitoring & Insights
      • Get User Profile
      • Get Statistics
      • Callbacks
    • Model Persistence
      • Save Model
      • Load Model
      • Use Case: Graceful Restarts
    • Integration Examples
      • Flask
      • FastAPI
      • Django
    • Best Practices
      • 1. Start Conservative
      • 2. Use Appropriate Identifiers
      • 3. Monitor and Alert
      • 4. Combine with Traditional Limits
      • 5. Persist Models

Framework Integration

  • Flask Integration
    • Installation
    • Quick Start
    • Basic Usage
      • Decorator-based Limiting
      • Multiple Limits
    • Custom Key Functions
      • By IP Address
      • By User
      • By API Key
    • Configuration
      • Flask Configuration
      • With Redis Storage
    • Error Handling
      • Custom Error Handler
      • Response Headers
    • Complete Example
    • Best Practices
    • Next Steps
  • FastAPI Integration
    • Installation
    • Quick Start
    • Basic Usage
      • Dependency Injection Pattern
      • Alternative: Using dependencies Parameter
    • Configuration
      • With Redis Storage
    • Custom Key Functions
      • By IP Address (Default)
      • By User ID
      • By API Key
    • Error Handling
      • Custom Exception Handler
    • Complete Example
    • Next Steps
  • Django Integration
    • Installation
    • Quick Start
    • Usage
      • Using the Decorator
    • Configuration
      • Settings
    • Complete Example
    • Next Steps
  • Starlette Integration
    • Installation
    • Quick Start
    • Complete Example
    • Next Steps

Protocols Reference

  • GRPC Rate Limiting
    • Overview
    • Installation
    • Quick Start
      • 1. Basic Server with Rate Limiting
    • Complete Examples
      • Example 1: User Service with Global Rate Limiting
      • Example 2: Per-Method Rate Limiting
      • Example 3: Custom Client ID Extraction
      • Example 4: Per-Service Rate Limits
      • Example 5: Multiple Services with Different Limits
      • Example 6: Streaming RPCs
      • Example 7: Violation Callbacks
      • Example 8: Redis Storage for Distributed Systems
    • Client-Side Usage
      • Handling Rate Limit Errors
      • Reading Rate Limit Headers
    • Configuration Examples
      • Public API (Strict)
      • Authenticated API (Moderate)
      • Internal Services (Generous)
    • Monitoring & Statistics
    • Protobuf Example
    • Best Practices
      • 1. Use Per-Method Limits for Fine Control
      • 2. Combine Global + Method Limits
      • 3. Use Custom Metadata for Better Tracking
      • 4. Monitor Violations
    • Summary
    • Next Steps
  • GraphQL Rate Limiting
    • Overview
    • Installation
    • Quick Start
      • 1. Basic Rate Limiting
    • Framework Integrations
      • 1. Ariadne
      • 2. Graphene (Django/Flask)
      • 3. Strawberry (FastAPI)
    • Complete Examples
      • Example 1: E-commerce API
      • Example 2: Social Network API
    • Complexity Analysis
      • How Complexity is Calculated
      • Custom Field Costs
    • Depth Limiting
    • Field-Level Rate Limiting
    • Violation Callbacks
    • Configuration Examples
      • Public API (Strict)
      • Authenticated API (Moderate)
      • Premium/Internal (Generous)
    • Best Practices
      • 1. Set Reasonable Complexity Limits
      • 2. Define Custom Costs for Expensive Fields
      • 3. Use Field-Level Limits for Critical Operations
      • 4. Monitor and Adjust
    • Summary
    • Next Steps
  • WebSocket Rate Limiting
    • Overview
    • Quick Start
      • Installation
    • Basic Usage
      • Simple Rate Limiter
    • Framework Integrations
      • 1. FastAPI WebSocket
      • 2. Socket.IO
      • 3. Django Channels
    • Advanced Usage
      • Custom Client ID Extraction
      • Per-Room/Channel Limits
      • Violation Callbacks
      • Statistics and Monitoring
    • Complete Examples
      • Example 1: Real-Time Chat
      • Example 2: Live Dashboard
    • Configuration Examples
      • Strict Limits (API)
      • Moderate Limits (Chat)
      • Generous Limits (Internal Tools)
    • Best Practices
      • 1. Choose Appropriate Limits
      • 2. Handle Rate Limit Gracefully
      • 3. Monitor and Alert
      • 4. Use Redis for Distributed Systems
    • Summary
    • Next Steps

Advanced Features

  • DDoS Protection
    • Overview
    • Quick Start
    • Configuration
    • Detection Methods
      • High Request Rate
      • Scanning Behavior
      • Bot Behavior
    • Usage Examples
      • Basic Protection
      • With Auto-Blocking
    • Monitoring
      • Get Statistics
      • Blocked IPs
      • Unblock IP
    • Integration with Rate Limiting
    • Best Practices
    • Next Steps
  • Analytics and Reporting
    • Overview
    • Quick Start
    • Configuration
    • Recording Data
      • Record Requests
      • Record Violations
    • Analyzing Data
      • Top Violators
      • Violation Timeline
      • Rule Statistics
    • Exporting Data
      • Export to JSON
      • Export to CSV
    • Best Practices
    • Next Steps
  • Command Line Interface
    • Installation
    • Usage
      • Basic Commands
      • Testing Rate Limits
      • Viewing Metrics
      • Managing Whitelist/Blacklist
      • Statistics
      • Configuration
    • Next Steps
  • ML Adaptive - Reference
    • Installation
    • Basic Usage
    • Configuration Quick Reference
    • Result Fields
    • Common Patterns
      • Pattern 1: Simple Integration
      • Pattern 2: User-Based Limiting
      • Pattern 3: With Callbacks
      • Pattern 4: Tiered Limits
      • Pattern 5: Model Persistence
    • Example Applications
      • Example 1: Public API
      • Example 2: SaaS Application
      • Example 3: E-commerce Checkout
      • Example 4: API Gateway
      • Example 5: WebSocket with Adaptive Limiting
    • Tips & Tricks
      • Tip 1: Start Conservative, Then Loosen
      • Tip 2: Different Limiters for Different Endpoints
      • Tip 3: Combine with Traditional Limits
      • Tip 4: Manual Trust Adjustments
    • Cheat Sheet
    • Summary
    • Next Steps
  • Distributed Deployments
    • Overview
    • Architecture
    • Setup
      • Each Server
    • High Availability
    • Best Practices
    • Next Steps
  • Monitoring and Alerting
    • Overview
    • Monitoring Quick Start
    • Key Monitoring Options
    • Alerting Quick Start
    • How Alerting Works
    • Configuration Reference
    • Integration Example
    • Best Practices
    • Troubleshooting
ratethrottle
  • Search


© Copyright 2026, MykeChidi.

Built with Sphinx using a theme provided by Read the Docs.