TsgcWSRateLimiterProperties › FixedWindow

FixedWindow Property

Fixed Window algorithm configuration: MaxRequests inside a clock-aligned WindowSec.

Syntax

property FixedWindow: TsgcRateLimitFixedWindow read FFixedWindow
      write SetFixedWindow;

Default Value

Remarks

Counts requests within a fixed clock window of WindowSec seconds and resets the counter to zero at the window boundary. The simplest and cheapest algorithm memory-wise, but it can allow up to 2×MaxRequests within a short period around a boundary crossing. Best for billing-style quotas ("1000 requests per hour, counter resets on the hour") where the billing unit is the hour, customers expect a clearly visible reset time, and the minor boundary-burst behavior is acceptable.

Example

// Billing-style: 1000 requests per hour, resets on the hour
sgcWSRateLimiter1.FixedWindow.Enabled := True;
sgcWSRateLimiter1.FixedWindow.WindowSec := 3600;
sgcWSRateLimiter1.FixedWindow.MaxRequests := 1000;

Back to Properties