You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/** L1 幂等缓存 TTL24 小时 */
export const L1_TTL_SECONDS = 86_400;
/** L2 热缓存基础 TTL3 分钟 */
export const L2_TTL_BASE_SECONDS = 180;
/** L2 TTL 随机抖动上限0~30 秒 */
export const L2_TTL_JITTER_MAX_SECONDS = 30;
/** L3 stale 缓存 TTL30 分钟 */
export const L3_TTL_SECONDS = 1_800;
/** 缓存击穿锁 TTL5 秒 */
export const LOCK_TTL_SECONDS = 5;
/** 未获锁时等待后重读 L2 的毫秒数 */
export const LOCK_WAIT_MS = 2_000;
/** 单客户限流60 次/分钟 */
export const CUSTOMER_RATE_LIMIT = 60;
/** 客户限流窗口60 秒 */
export const CUSTOMER_RATE_WINDOW_SECONDS = 60;
/** 单 IP 限流1000 次/分钟 */
export const IP_RATE_LIMIT = 1_000;
/** IP 限流窗口60 秒 */
export const IP_RATE_WINDOW_SECONDS = 60;
/** IP 封禁时长10 分钟 */
export const IP_BAN_TTL_SECONDS = 600;
/** RPA 熔断状态 TTL10 分钟 */
export const CIRCUIT_TTL_SECONDS = 600;
/** 连续 RPA 失败次数阈值,达到后熔断 */
export const CIRCUIT_FAILURE_THRESHOLD = 3;