Microsoft .NET 7 will include rate limiting

Microsoft .NET 7, a planned upgrade to Microsoft’s flagship software development platform, is set to include built-in rate limiting, a mechanism designed to protect an application from being overloaded with traffic.

Microsoft provided details in a Blog post from July 13th. Rate limiting provides control over how much of a resource can be accessed. For example, a developer may know that a database accessed by an application can safely handle 1000 queries per minute. A rate limiter can be placed on the application that allows 1000 requests, but rejects requests above that number before they can access the database.

Microsoft .NET 7 will feature multiple rate limiting algorithms to control the flow of requests. Among them are a concurrency limiter to limit the number of concurrent requests; token bucket limit, a way to throttle application requests using tokens; a fixed window limit that resets the limit back to the starting point after a certain period of time; and a sliding window constraint, which is similar to the fixed window algorithm but divides the time window into segments.

Microsoft has released a Nuget package, System.Threading.RateLimiting, which provides write rate limiting primitives using common algorithms. The rate limiting middleware is provided in the Microsoft.Asp.NetCoreRateLimiting Nuget package.

Microsoft is looking for developer feedback on the .NET 7 rate limiting API. For the rate limiting API in the System.Threading.RateLimiting namespace, use System.Threading.RateLimiting Nuget package and provide feedback in Implementation repo on GitHub. For rate limiting middleware use Microsoft.AspNetCore.RateLimiting Nuget package and provide feedback in AspNetCore GitHub repo.

Copyright © 2022 IDG Communications, Inc.

Exit mobile version