返回顶部
r

rate-limiting

Deep rate limiting workflow—identifying actors and resources, choosing algorithms, distributed vs local limits, client UX (headers, retries), and abuse detection. Use when protecting APIs, gateways, or multi-tenant SaaS workloads.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
98
下载量
0
收藏
概述
安装方式
版本历史

rate-limiting

# Rate Limiting (Deep Workflow) Rate limits balance **fairness**, **availability**, and **abuse prevention**. Design explicitly: **who** is throttled, **what** resource is limited, and how clients should **back off**. ## When to Offer This Workflow **Trigger conditions:** - Protecting public APIs, auth endpoints, or expensive operations - Multi-tenant “noisy neighbor” isolation - Retry storms after incidents causing cascading 429/502 **Initial offer:** Use **six stages**: (1) threat & fairness model, (2) dimensions & keys, (3) algorithms & config, (4) distributed enforcement, (5) client protocol & UX, (6) observability & tuning). Confirm enforcement layer (API gateway vs app middleware vs edge). --- ## Stage 1: Threat & Fairness Model **Goal:** Distinguish legitimate bursts (batch jobs, mobile retries) from abuse; align limits with product tiers and SLAs. **Exit condition:** Written policy: free vs paid limits, partner caps, burst allowances. --- ## Stage 2: Dimensions & Keys **Goal:** Choose stable limit keys: authenticated user id > API key > IP (with shared-NAT caveats). ### Practices - Per-tenant and global limits; separate expensive routes (exports, search) --- ## Stage 3: Algorithms & Config **Goal:** Token bucket / leaky bucket for smooth bursts; sliding window for strict per-minute caps; consider **concurrency** limits separately from request rate. --- ## Stage 4: Distributed Enforcement **Goal:** Central store (Redis, etc.) with atomic increments; handle multi-region (sticky routing vs shared counters); mind clock skew. --- ## Stage 5: Client Protocol & UX **Goal:** Consistent **429** responses with **`Retry-After`**; document exponential backoff + jitter; optional `X-RateLimit-*` headers for transparency. --- ## Stage 6: Observability & Tuning **Goal:** Metrics on throttles by route and actor class; alerts on abnormal deny spikes (attack vs misconfigured client). --- ## Final Review Checklist - [ ] Policy matches tiers and fairness goals - [ ] Limit keys stable and hard to spoof - [ ] Algorithm matches burst vs sustained semantics - [ ] Distributed correctness considered - [ ] Client-facing 429 behavior documented - [ ] Metrics and tuning loop defined ## Tips for Effective Guidance - Coordinate with authentication—anonymous IP limits are coarse. - Don’t throttle health checks in ways that break monitors. - GraphQL: consider query **cost** / depth limits, not only HTTP count. - WebSockets: separate connection caps from message rate limits. ## Handling Deviations - **Edge/CDN:** limits may differ from origin—document both layers.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 rate-limiting-1776028935 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 rate-limiting-1776028935 技能

通过命令行安装

skillhub install rate-limiting-1776028935

下载 Zip 包

⬇ 下载 rate-limiting v1.0.0

文件大小: 2.1 KB | 发布时间: 2026-4-13 11:43

v1.0.0 最新 2026-4-13 11:43
- Initial release of the "rate-limiting" workflow skill.
- Guides users through a deep, 6-stage process: threat & fairness modeling, key/dimension selection, algorithm choice, distributed enforcement, client experience, and observability.
- Designed for protecting APIs, gateways, and multi-tenant SaaS workloads.
- Includes best practices, example policies, review checklists, and advice for handling common deviations.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部