AICentral.RateLimiting.DistributedRedis 0.20.5-pullrequest0148-0004

This is a prerelease version of AICentral.RateLimiting.DistributedRedis.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AICentral.RateLimiting.DistributedRedis --version 0.20.5-pullrequest0148-0004
                    
NuGet\Install-Package AICentral.RateLimiting.DistributedRedis -Version 0.20.5-pullrequest0148-0004
                    
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.20.5-pullrequest0148-0004" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AICentral.RateLimiting.DistributedRedis" Version="0.20.5-pullrequest0148-0004" />
                    
Directory.Packages.props
<PackageReference Include="AICentral.RateLimiting.DistributedRedis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AICentral.RateLimiting.DistributedRedis --version 0.20.5-pullrequest0148-0004
                    
#r "nuget: AICentral.RateLimiting.DistributedRedis, 0.20.5-pullrequest0148-0004"
                    
#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.
#:package AICentral.RateLimiting.DistributedRedis@0.20.5-pullrequest0148-0004
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AICentral.RateLimiting.DistributedRedis&version=0.20.5-pullrequest0148-0004&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AICentral.RateLimiting.DistributedRedis&version=0.20.5-pullrequest0148-0004&prerelease
                    
Install as a Cake Tool

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 168 12/9/2024
0.21.0-pullrequest0152-0005 161 12/9/2024
0.21.0-pullrequest0152-0004 135 12/9/2024
0.20.5 161 9/30/2024
0.20.5-pullrequest0148-0004 142 9/30/2024
0.20.5-pullrequest0148-0002 110 9/30/2024
0.20.3 161 9/5/2024
0.20.3-pullrequest0146-0005 151 9/5/2024
0.20.3-pullrequest0146-0004 140 9/5/2024
0.20.0 158 8/17/2024
0.20.0-pullrequest0143-0013 135 8/17/2024
0.20.0-pullrequest0143-0012 148 8/17/2024
0.20.0-pullrequest0143-0011 135 8/17/2024
0.20.0-pullrequest0143-0010 145 8/17/2024
0.20.0-pullrequest0143-0009 149 8/17/2024
0.19.6-pullrequest0143-0008 149 8/17/2024
0.19.0 148 7/29/2024
0.19.0-pullrequest0136-0014 120 7/29/2024
0.19.0-pullrequest0136-0013 121 7/29/2024
0.19.0-pullrequest0136-0012 115 7/29/2024
0.19.0-pullrequest0136-0011 131 7/29/2024
0.19.0-pullrequest0136-0010 120 7/29/2024
0.19.0-pullrequest0136-0009 127 7/27/2024
0.19.0-pullrequest0136-0008 137 7/27/2024
0.19.0-pullrequest0136-0007 126 7/27/2024
0.18.7-pullrequest0136-0006 133 7/27/2024
0.18.1 170 7/10/2024
0.18.1-pullrequest0129-0007 130 7/10/2024
0.18.0 196 7/10/2024
0.18.0-pullrequest0125-0014 130 7/10/2024
0.18.0-pullrequest0125-0013 137 7/10/2024
0.18.0-pullrequest0125-0012 146 7/10/2024
0.18.0-pullrequest0125-0011 141 7/10/2024
0.18.0-pullrequest0125-0010 146 7/10/2024
0.18.0-pullrequest0125-0009 143 7/10/2024
0.17.0 139 7/8/2024
0.17.0-pullrequest0123-0024 130 7/8/2024
0.17.0-pullrequest0123-0023 115 7/8/2024
0.17.0-pullrequest0123-0021 142 7/8/2024
0.17.0-pullrequest0123-0020 134 7/8/2024
0.17.0-pullrequest0123-0019 115 7/8/2024
0.17.0-pullrequest0123-0018 119 7/8/2024
0.17.0-pullrequest0123-0017 129 7/8/2024
0.17.0-pullrequest0123-0016 146 7/8/2024
0.17.0-pullrequest0123-0015 128 7/8/2024
0.17.0-pullrequest0123-0014 119 7/8/2024
0.17.0-pullrequest0123-0013 110 7/8/2024
0.17.0-pullrequest0123-0012 116 7/8/2024
0.17.0-pullrequest0123-0011 129 7/8/2024
0.17.0-pullrequest0123-0009 346 7/6/2024
0.17.0-pullrequest0123-0008 126 7/6/2024
0.16.23 129 6/12/2024
0.16.23-pullrequest0118-0005 129 6/12/2024
0.16.23-pullrequest0118-0004 125 6/12/2024
0.16.23-pullrequest0118-0003 123 6/12/2024