Skip to content

Commit

Permalink
chore(api): Increase rate limit window duration to 5 seconds (#6759)
Browse files Browse the repository at this point in the history
  • Loading branch information
rifont authored Oct 23, 2024
1 parent 991a1da commit 6c8a47d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/shared/src/consts/rate-limiting/apiRateLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ import { ApiRateLimitCategoryEnum, IApiRateLimitServiceMaximum } from '../../typ
export const DEFAULT_API_RATE_LIMIT_SERVICE_MAXIMUM_CONFIG: IApiRateLimitServiceMaximum = {
[ApiServiceLevelEnum.FREE]: {
[ApiRateLimitCategoryEnum.TRIGGER]: 60,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 15,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 20,
[ApiRateLimitCategoryEnum.GLOBAL]: 30,
},
[ApiServiceLevelEnum.BUSINESS]: {
[ApiRateLimitCategoryEnum.TRIGGER]: 600,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 150,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 200,
[ApiRateLimitCategoryEnum.GLOBAL]: 300,
},
[ApiServiceLevelEnum.ENTERPRISE]: {
[ApiRateLimitCategoryEnum.TRIGGER]: 6000,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 1500,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 2000,
[ApiRateLimitCategoryEnum.GLOBAL]: 3000,
},
[ApiServiceLevelEnum.UNLIMITED]: {
[ApiRateLimitCategoryEnum.TRIGGER]: 6000,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 1500,
[ApiRateLimitCategoryEnum.CONFIGURATION]: 2000,
[ApiRateLimitCategoryEnum.GLOBAL]: 3000,
},
};

export const DEFAULT_API_RATE_LIMIT_ALGORITHM_CONFIG: IApiRateLimitAlgorithm = {
[ApiRateLimitAlgorithmEnum.BURST_ALLOWANCE]: 0.1,
[ApiRateLimitAlgorithmEnum.WINDOW_DURATION]: 1,
[ApiRateLimitAlgorithmEnum.BURST_ALLOWANCE]: 0.1, // allow 10% burst
[ApiRateLimitAlgorithmEnum.WINDOW_DURATION]: 5, // 5 second window duration
};

export const DEFAULT_API_RATE_LIMIT_COST_CONFIG: IApiRateLimitCost = {
Expand Down

0 comments on commit 6c8a47d

Please sign in to comment.