# TraconRateLimitOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconratelimitoptions/
> Summary: TraconRateLimitOptions: Rate-limit settings applied to Tracon endpoints.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Core.dll</code></div>

Rate-limit settings applied to Tracon endpoints.

```csharp
public sealed class TraconRateLimitOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconratelimitoptions/">TraconRateLimitOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

Read from the `Tracon:RateLimit` configuration section.

**Off by default**. It has no way of knowing a
library consumer's traffic; a default that comes on would silently answer an
upgrading setup's live traffic with `429`. Recommended values are documented in the README.

Rate limiting **is not a quota**: it smooths out sudden load at
the second/minute scale and lives in memory. Total-consumption limiting at
the day/month scale is done with [TraconQuotaOptions](/api/tracon.traconquotaoptions/) and
counted in the database.

The counter lives in the memory of a single process: Tracon ships no
distributed rate limiter. In a multi-instance deployment the limit therefore
applies **per instance** — two instances with a
[TraconRateLimitOptions.PermitLimit](/api/tracon.traconratelimitoptions/#Tracon_TraconRateLimitOptions_PermitLimit) of 100 together admit 200 requests per window, and
[RateLimitPartitionKind.Tenant](/api/tracon.ratelimitpartitionkind/) partitions that per-instance
window per tenant rather than across the deployment.
The inbound trigger rate limit has the same scope. A ceiling that
must hold for the deployment as a whole is a total-consumption question, so
it belongs to [TraconQuotaOptions](/api/tracon.traconquotaoptions/).

## Constructors

### <a id="Tracon_TraconRateLimitOptions__ctor"></a> TraconRateLimitOptions\(\)

```csharp
public TraconRateLimitOptions()
```

## Fields

### <a id="Tracon_TraconRateLimitOptions_SectionName"></a> SectionName

The configuration section name.

```csharp
public const string SectionName = "Tracon:RateLimit"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconRateLimitOptions_Enabled"></a> Enabled

Whether rate limiting is enabled. Default [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_TraconRateLimitOptions_Partition"></a> Partition

Which key the limit is partitioned by. Default is per tenant.

```csharp
public RateLimitPartitionKind Partition { get; set; }
```

#### Property Value

 [RateLimitPartitionKind](/api/tracon.ratelimitpartitionkind/)

### <a id="Tracon_TraconRateLimitOptions_PermitLimit"></a> PermitLimit

The number of requests allowed within a window.

```csharp
public int PermitLimit { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconRateLimitOptions_QueueLimit"></a> QueueLimit

The number of requests to queue once the limit is exceeded. If `0`,
a request gets `429` immediately.

```csharp
public int QueueLimit { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconRateLimitOptions_Window"></a> Window

The length of the window.

```csharp
public TimeSpan Window { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)
