Skip to content

Adaptive Rate Limiter extracted from vector.dev Dynamically Rate Limiting HTTP requests based on TCP's additive increase and multiplicative decrease (AIMD)

Notifications You must be signed in to change notification settings

TwistingTwists/rate_limiter_aimd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Concurrency Control Library

This Rust library provides adaptive concurrency control for network services, implementing an algorithm that automatically adjusts the maximum number of concurrent requests based on observed response times and backpressure signals.

Features

  • Adaptive concurrency limiting based on RTT measurements
  • Automatic scaling of concurrency limits
  • Integration with Reqwest for HTTP services
  • Configurable parameters for fine-tuning behavior
  • Support for retry logic and backpressure detection

Example Usage with OpenAI API

To run the OpenAI example:

  1. Set your Kluster AI API key:
export OPENAI_API_KEY='your-klusterai-api-key'
  1. Build and run the example:
cargo run --example openai_arc

The example demonstrates:

  • Setting up an adaptive concurrency client for OpenAI API
  • Configuring initial and max concurrency limits
  • Sending multiple requests concurrently
  • Handling responses with adaptive backpressure control

About

Adaptive Rate Limiter extracted from vector.dev Dynamically Rate Limiting HTTP requests based on TCP's additive increase and multiplicative decrease (AIMD)

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages