AICentral.RateLimiting.DistributedRedis 0.21.0

dotnet add package AICentral.RateLimiting.DistributedRedis --version 0.21.0                
NuGet\Install-Package AICentral.RateLimiting.DistributedRedis -Version 0.21.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AICentral.RateLimiting.DistributedRedis" Version="0.21.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AICentral.RateLimiting.DistributedRedis --version 0.21.0                
#r "nuget: AICentral.RateLimiting.DistributedRedis, 0.21.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AICentral.RateLimiting.DistributedRedis as a Cake Addin
#addin nuget:?package=AICentral.RateLimiting.DistributedRedis&version=0.21.0

// Install AICentral.RateLimiting.DistributedRedis as a Cake Tool
#tool nuget:?package=AICentral.RateLimiting.DistributedRedis&version=0.21.0                

AICentral.RateLimiting.DistributedRedis

A Distributed Rate Limiter for use with (AICentral)[www.github.com/microsoft/aicentral]

Configuration


dotnet add package AICentral.RateLimiting.DistributedRedis


builder.Services.AddAICentral(
    builder.Configuration,
    additionalComponentAssemblies:
    [
        typeof(DistributedRateLimiter).Assembly,
    ]);


{
  "AICentral": {
    "GenericSteps": [
      {
        "Type": "DistributedRateLimiter",
        "Name": "request-rate-limiter",
        "Properties": {
          "LimitType": "PerEndpoint|PerConsumer",
          "MetricType": "Tokens|Requests",
          "Window": "00:00:10",
          "PermitLimit": 100,
          "RedisConfiguration" : "<Redis connection string>"
        }
      }
    ]    
  }
}

How does it work?

For each pipeline a Redis Key is constructed which will identify this pipeline (optionally and the client) across AICentral Instances. We store a Hash against this Redis key which is the current count of requests or tokens used.

Importantly the Hash Key contains a value derived from a Static point in time and the window information. This means the Key will always be the same across instances.

The Rate Limiter checks the sum of all the Hashes for the current window and if it is greater than the limit then the request is rejected. The key automatically changes as we enter a new window meaning the totals are reset.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.21.0 83 12/9/2024
0.21.0-pullrequest0152-0005 82 12/9/2024
0.21.0-pullrequest0152-0004 72 12/9/2024
0.20.5 91 9/30/2024
0.20.5-pullrequest0148-0004 76 9/30/2024
0.20.5-pullrequest0148-0002 58 9/30/2024
0.20.3 108 9/5/2024
0.20.3-pullrequest0146-0005 87 9/5/2024
0.20.3-pullrequest0146-0004 84 9/5/2024
0.20.0 120 8/17/2024
0.20.0-pullrequest0143-0013 94 8/17/2024
0.20.0-pullrequest0143-0012 90 8/17/2024
0.20.0-pullrequest0143-0011 92 8/17/2024
0.20.0-pullrequest0143-0010 99 8/17/2024
0.20.0-pullrequest0143-0009 101 8/17/2024
0.19.6-pullrequest0143-0008 95 8/17/2024
0.19.0 89 7/29/2024
0.19.0-pullrequest0136-0014 76 7/29/2024
0.19.0-pullrequest0136-0013 74 7/29/2024
0.19.0-pullrequest0136-0012 78 7/29/2024
0.19.0-pullrequest0136-0011 73 7/29/2024
0.19.0-pullrequest0136-0010 78 7/29/2024
0.19.0-pullrequest0136-0009 80 7/27/2024
0.19.0-pullrequest0136-0008 78 7/27/2024
0.19.0-pullrequest0136-0007 81 7/27/2024
0.18.7-pullrequest0136-0006 81 7/27/2024
0.18.1 107 7/10/2024
0.18.1-pullrequest0129-0007 77 7/10/2024
0.18.0 127 7/10/2024
0.18.0-pullrequest0125-0014 80 7/10/2024
0.18.0-pullrequest0125-0013 93 7/10/2024
0.18.0-pullrequest0125-0012 83 7/10/2024
0.18.0-pullrequest0125-0011 82 7/10/2024
0.18.0-pullrequest0125-0010 81 7/10/2024
0.18.0-pullrequest0125-0009 85 7/10/2024
0.17.0 91 7/8/2024
0.17.0-pullrequest0123-0024 80 7/8/2024
0.17.0-pullrequest0123-0023 75 7/8/2024
0.17.0-pullrequest0123-0021 88 7/8/2024
0.17.0-pullrequest0123-0020 76 7/8/2024
0.17.0-pullrequest0123-0019 73 7/8/2024
0.17.0-pullrequest0123-0018 64 7/8/2024
0.17.0-pullrequest0123-0017 83 7/8/2024
0.17.0-pullrequest0123-0016 81 7/8/2024
0.17.0-pullrequest0123-0015 76 7/8/2024
0.17.0-pullrequest0123-0014 67 7/8/2024
0.17.0-pullrequest0123-0013 69 7/8/2024
0.17.0-pullrequest0123-0012 71 7/8/2024
0.17.0-pullrequest0123-0011 77 7/8/2024
0.17.0-pullrequest0123-0009 302 7/6/2024
0.17.0-pullrequest0123-0008 77 7/6/2024
0.16.23 89 6/12/2024
0.16.23-pullrequest0118-0005 78 6/12/2024
0.16.23-pullrequest0118-0004 74 6/12/2024
0.16.23-pullrequest0118-0003 76 6/12/2024