This playbook helps identify scalability bottlenecks and compare responses such as database indexes, caching, replicas, load balancing, and architectural changes. It includes scaling triggers, phased growth plans with cost estimates, a load-testing example, and best practices for validating and monitoring changes.
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/scalability-playbook/SKILL.mdSystematic approach to identifying and resolving scalability bottlenecks.
Traffic: 1,000 req/min
Users: 10,000 active
Data: 100GB database
Response time: p95 = 500msSymptom: 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 ReplicasExpected Impact: 3x read capacity Cost: $300/month Effort: 1 week
Problem: Single point of failure Solution:
ALB
├── Server 1
├── Server 2
└── Server 3Expected 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 immediatelyExpected 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-99999Expected 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 CExpected 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 |sathishssj3/Stereix-Engine
1e0ee85
heyhttps://api.example.comIf you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.