重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
scalability-playbook by patricio0312rev/skills
npx skills add https://github.com/patricio0312rev/skills --skill scalability-playbook系统性识别和解决可扩展性瓶颈的方法。
Traffic: 1,000 req/min
Users: 10,000 active
Data: 100GB database
Response time: p95 = 500ms
症状: 页面加载缓慢(2-3秒) 测量指标: 查询时间 p95 = 800ms 影响: 高 - 影响所有读取操作 触发条件: 当 p95 >500ms 时
症状: CPU 使用率高(>80%) 测量指标: 平均负载 >4 影响: 中等 - 间歇性减速 触发条件: 当 CPU >70% 时
症状: 重复的数据库查询 测量指标: 缓存命中率 = 0% 影响: 中等 - 不必要的负载 触发条件: 当查询量 >10k/分钟 时
问题: 查询缓慢 解决方案:
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_orders_user_created ON orders(user_id, created_at);
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
预期影响: 查询速度提升 80% 成本: $0 工作量: 1 天
问题: 重复查询 解决方案: Redis 缓存层
const cached = await redis.get(`user:${userId}`);
if (cached) return JSON.parse(cached);
const user = await db.users.findById(userId);
await redis.setex(`user:${userId}`, 3600, JSON.stringify(user));
预期影响: 数据库负载减少 60% 成本: $50/月 工作量: 2 天
问题: 读密集型工作负载 解决方案: 将读取请求路由到副本
Write Load: Primary DB
Read Load: 3x Read Replicas
预期影响: 读取容量提升 3 倍 成本: $300/月 工作量: 1 周
问题: 单点故障 解决方案:
ALB
├── Server 1
├── Server 2
└── Server 3
预期影响: 吞吐量提升 3 倍 成本: $400/月 工作量: 1 周
问题: 资源交付缓慢 解决方案: CloudFront CDN 预期影响: 资源加载速度提升 90% 成本: $100/月 工作量: 1 周
问题: 同步操作缓慢 解决方案: 后台作业队列
// Before: Sync
await sendEmail(user);
await processPayment(order);
await updateAnalytics(event);
return response; // Waits 5+ seconds
// After: Async
await queue.add("send-email", { userId });
await queue.add("process-payment", { orderId });
await queue.add("update-analytics", { event });
return response; // Returns immediately
预期影响: 响应速度提升 80% 成本: $50/月 (SQS) 工作量: 2 周
问题: 单一数据库过大 解决方案: 按 user_id 分片
Shard 1: user_id 0-24999
Shard 2: user_id 25000-49999
Shard 3: user_id 50000-74999
Shard 4: user_id 75000-99999
预期影响: 容量提升 4 倍 成本: $1,200/月 工作量: 2 个月
问题: 紧耦合,级联故障 解决方案: 消息代理 (Kafka)
Service A → Kafka → Service B
↘ ↗ Service C
预期影响: 更好的隔离性和弹性 成本: $500/月 工作量: 3 个月
| Metric | Current | Warning | Critical | Action |
| ---------------- | ------- | ------- | -------- | ----------------------- |
| CPU | 40% | 70% | 85% | Add servers |
| Memory | 50% | 75% | 90% | Upgrade instances |
| DB Connections | 20 | 40 | 50 | Add read replicas |
| Query Time (p95) | 200ms | 500ms | 1000ms | Add indexes |
| Queue Depth | 100 | 1000 | 5000 | Add workers |
| Error Rate | 0.1% | 1% | 5% | Investigate immediately |
目标: 10,000 请求/分钟,100K 用户
行动:
成本: $500 → $1,000/月
目标: 100,000 请求/分钟,1M 用户
行动:
成本: $1,000 → $10,000/月
目标: 1M 请求/分钟,10M 用户
行动:
成本: $10,000 → $100,000/月
# Current baseline
hey -n 10000 -c 100 https://api.example.com/users
# Target 10x
hey -n 100000 -c 1000 https://api.example.com/users
# Measure:
# - Requests/sec
# - p50, p95, p99 latency
# - Error rate
# - Resource utilization
| Strategy | Cost/Month | Expected Impact | ROI | Priority |
| ------------- | ---------- | ------------------ | --- | -------- |
| DB Indexes | $0 | 80% faster queries | ∞ | HIGH |
| Redis Cache | $50 | 60% less DB load | 12x | HIGH |
| Read Replicas | $300 | 3x capacity | 10x | MEDIUM |
| Load Balancer | $400 | 3x throughput | 7x | MEDIUM |
| DB Sharding | $1,200 | 4x capacity | 3x | LOW |
每周安装次数
55
代码仓库
GitHub 星标数
20
首次出现
2026年1月24日
安全审计
安装于
codex47
opencode47
gemini-cli46
github-copilot45
cursor44
claude-code41
Systematic approach to identifying and resolving scalability bottlenecks.
Traffic: 1,000 req/min
Users: 10,000 active
Data: 100GB database
Response time: p95 = 500ms
Symptom: Slow page loads (2-3s) Measurement: Query time p95 = 800ms Impact: HIGH - affects all reads Trigger: When p95 >500ms
Symptom: High CPU (>80%) Measurement: Load average >4 Impact: MEDIUM - intermittent slowdowns Trigger: When CPU >70%
Symptom: Repeated DB queries Measurement: Cache hit rate = 0% Impact: MEDIUM - unnecessary load Trigger: When query volume >10k/min
Problem: Slow queries Solution:
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_orders_user_created ON orders(user_id, created_at);
Expected Impact: 80% faster queries Cost: $0 Effort: 1 day
Problem: Repeated queries Solution: Redis cache layer
const cached = await redis.get(`user:${userId}`);
if (cached) return JSON.parse(cached);
const user = await db.users.findById(userId);
await redis.setex(`user:${userId}`, 3600, JSON.stringify(user));
Expected Impact: 60% reduction in DB load Cost: $50/month Effort: 2 days
Problem: Read-heavy workload Solution: Route reads to replicas
Write Load: Primary DB
Read Load: 3x Read Replicas
Expected Impact: 3x read capacity Cost: $300/month Effort: 1 week
Problem: Single point of failure Solution:
ALB
├── Server 1
├── Server 2
└── Server 3
Expected Impact: 3x throughput Cost: $400/month Effort: 1 week
Problem: Slow asset delivery Solution: CloudFront CDN Expected Impact: 90% faster asset loads Cost: $100/month Effort: 1 week
Problem: Slow sync operations Solution: Background job queues
// Before: Sync
await sendEmail(user);
await processPayment(order);
await updateAnalytics(event);
return response; // Waits 5+ seconds
// After: Async
await queue.add("send-email", { userId });
await queue.add("process-payment", { orderId });
await queue.add("update-analytics", { event });
return response; // Returns immediately
Expected Impact: 80% faster responses Cost: $50/month (SQS) Effort: 2 weeks
Problem: Single DB too large Solution: Shard by user_id
Shard 1: user_id 0-24999
Shard 2: user_id 25000-49999
Shard 3: user_id 50000-74999
Shard 4: user_id 75000-99999
Expected Impact: 4x capacity Cost: $1,200/month Effort: 2 months
Problem: Tight coupling, cascading failures Solution: Message broker (Kafka)
Service A → Kafka → Service B
↘ ↗ Service C
Expected Impact: Better isolation, resilience Cost: $500/month Effort: 3 months
| Metric | Current | Warning | Critical | Action |
| ---------------- | ------- | ------- | -------- | ----------------------- |
| CPU | 40% | 70% | 85% | Add servers |
| Memory | 50% | 75% | 90% | Upgrade instances |
| DB Connections | 20 | 40 | 50 | Add read replicas |
| Query Time (p95) | 200ms | 500ms | 1000ms | Add indexes |
| Queue Depth | 100 | 1000 | 5000 | Add workers |
| Error Rate | 0.1% | 1% | 5% | Investigate immediately |
Target: 10,000 req/min, 100K users
Actions:
Cost: $500 → $1,000/month
Target: 100,000 req/min, 1M users
Actions:
Cost: $1,000 → $10,000/month
Target: 1M req/min, 10M users
Actions:
Cost: $10,000 → $100,000/month
# Current baseline
hey -n 10000 -c 100 https://api.example.com/users
# Target 10x
hey -n 100000 -c 1000 https://api.example.com/users
# Measure:
# - Requests/sec
# - p50, p95, p99 latency
# - Error rate
# - Resource utilization
| Strategy | Cost/Month | Expected Impact | ROI | Priority |
| ------------- | ---------- | ------------------ | --- | -------- |
| DB Indexes | $0 | 80% faster queries | ∞ | HIGH |
| Redis Cache | $50 | 60% less DB load | 12x | HIGH |
| Read Replicas | $300 | 3x capacity | 10x | MEDIUM |
| Load Balancer | $400 | 3x throughput | 7x | MEDIUM |
| DB Sharding | $1,200 | 4x capacity | 3x | LOW |
Weekly Installs
55
Repository
GitHub Stars
20
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex47
opencode47
gemini-cli46
github-copilot45
cursor44
claude-code41
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
118,400 周安装