feat: expand gen2D deck with deep technical slides and interactive elements
Deploy Slides / build-and-deploy (push) Successful in 1m8s
Deploy Slides / build-and-deploy (push) Successful in 1m8s
- Add 5 new slide pages: eino-deep-dive, ratelimit-overview, ratelimit-lua, async-deep-dive, harness - Add 4 new drawio SVGs: pipeline-detail, ratelimit, async-task, harness - Update all existing slides with v-clicks progressive reveal - Add presenter notes and interactive prompts - Expand slides.md to register all new pages (16 → 25+ slides) - Fix text overflow by trimming content per Item block - Add Eino Graph deep dive: WithGenLocalState, Pre/Post Handler, branch routing - Add rate limiting section: algorithm comparison, Lua script, Gin middleware - Add async task deep dive: TaskQueue FIFO, context progress injection - Add consistency section: style/pipeline/data/deployment 4-layer guarantees
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# 分布式限流 — 算法选型与架构
|
||||
|
||||
保护 API 端点,防止资源滥用
|
||||
|
||||
<div class="mt-2">
|
||||
|
||||
| 算法 | 优点 | 缺点 | 适用场景 |
|
||||
|------|------|------|----------|
|
||||
| 固定窗口计数器 | 实现简单 | 窗口边界突发 | 低精度场景 |
|
||||
| 滑动窗口 | 边界平滑 | 内存开销大 | 中等精度 |
|
||||
| 漏桶 | 严格平滑 | 无法应对突发 | 流量整形 |
|
||||
| **令牌桶** | **平滑 + 允许突发** | 实现稍复杂 | **API 限流** |
|
||||
|
||||
</div>
|
||||
|
||||
<v-clicks>
|
||||
|
||||
<Item title="选择令牌桶 — 平滑限速 + 突发容忍">
|
||||
令牌按固定速率填充,请求消耗令牌。桶满时可应对短时突发流量,同时保持长期平均速率稳定。
|
||||
</Item>
|
||||
|
||||
<Item title="两级限流架构">
|
||||
**用户级**:per-user 维度,防止单用户滥用。**全局级**:per-endpoint 维度,保护后端服务总容量。两级独立配置,互不影响。
|
||||
</Item>
|
||||
|
||||
<Item title="容错策略 — Fail-Open">
|
||||
Redis 不可用时限流器自动放行(fail-open),保障核心业务不因限流组件故障而中断。
|
||||
</Item>
|
||||
|
||||
</v-clicks>
|
||||
|
||||
<div class="flex justify-center mt-2">
|
||||
<img src="../public/ratelimit.svg" class="w-full max-h-[180px] object-contain" />
|
||||
</div>
|
||||
Reference in New Issue
Block a user