Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

estimation-techniques估计技术

Agent Skill

estimation-techniques 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

233

周安装

10

GitHub Stars

61

下载量

82
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:estimation-techniques(估计技术)
来源仓库:https://github.com/melodic-software/claude-code-plugins
仓库路径:skills/estimation-techniques
安装命令:
npx skills add https://github.com/melodic-software/claude-code-plugins --skill estimation-techniques
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/melodic-software/claude-code-plugins --skill estimation-techniques

简介

estimation-techniques 提供系统设计和容量规划所需的粗略计算框架,适用于估算系统容量、存储需求和基础设施规模。

  • 适合在估算系统承载能力、计算功能存储需求或确定带宽要求时使用,尤其用于架构决策和系统设计面试准备。
  • 使用时聚焦关键参数输入,输出为数量级合理的估算结果,不追求精确值;支持 QPS、延迟和存储等常见指标。
  • 安装前需确认宿主环境兼容性,注意是否会触发网络请求或文件操作,建议结合原始文档验证具体调用方式。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Estimation Techniques

This skill provides frameworks for back-of-envelope calculations essential for system design and capacity planning.

When to Use This Skill

Keywords: back-of-envelope, estimation, QPS, storage calculation, bandwidth, latency, capacity planning, scale estimation

Use this skill when:

  • Estimating system capacity requirements
  • Calculating storage needs for a feature
  • Determining bandwidth requirements
  • Sizing infrastructure for expected load
  • Justifying architectural decisions with numbers
  • Preparing for system design interviews

Core Principle

Estimation is not about precision, it's about order of magnitude.

Getting within 10x is usually good enough for architectural decisions. The goal is to identify if you need:

  • 1 server or 100 servers
  • 1 GB or 1 TB of storage
  • 10 ms or 1 second latency

Essential Numbers to Know

Powers of 2

PowerValueApproximate
2^101,024~1 Thousand (KB)
2^201,048,576~1 Million (MB)
2^301,073,741,824~1 Billion (GB)
2^401,099,511,627,776~1 Trillion (TB)

Time Conversions

UnitSecondsUseful For
1 minute60Short operations
1 hour3,600Batch jobs
1 day86,400 (~100K)Daily aggregations
1 month2,592,000 (~2.5M)Monthly calculations
1 year31,536,000 (~30M)Annual projections

Availability Targets

AvailabilityDowntime/YearDowntime/MonthDowntime/Day
99% (two 9s)3.65 days7.31 hours14.4 min
99.9% (three 9s)8.76 hours43.8 min1.44 min
99.99% (four 9s)52.6 min4.38 min8.64 sec
99.999% (five 9s)5.26 min26.3 sec864 ms

Latency Numbers Every Programmer Should Know

See full reference: references/latency-numbers.md

Quick reference:

OperationLatencyRelative
L1 cache reference0.5 ns1x
L2 cache reference7 ns14x
Main memory reference100 ns200x
SSD random read16 us32,000x
HDD seek2 ms4,000,000x
Round trip same datacenter0.5 ms1,000,000x
Round trip CA to Netherlands150 ms300,000,000x

Estimation Patterns

Pattern 1: QPS (Queries Per Second)

Formula

QPS = (Number of Users) x (Actions per User per Day) / (Seconds per Day)

Example: Twitter-like service

Given:
- 300 million monthly active users
- 50% are daily active = 150M DAU
- Average user reads 20 tweets/day

QPS = 150M * 20 / 86,400
    = 3 billion / 100,000
    = 30,000 QPS

Peak load (typically 2-3x average):
Peak QPS = 30,000 * 3 = 90,000 QPS

Pattern 2: Storage Estimation

Formula

Storage = (Number of Items) x (Size per Item) x (Replication Factor) x (Time Period)

Example: Photo storage service

Given:
- 100 million users
- 10% upload daily = 10M uploads/day
- Average photo size = 2 MB
- Keep 5 years of data
- Replication factor = 3

Daily storage = 10M * 2 MB = 20 TB
Yearly storage = 20 TB * 365 = 7.3 PB
5-year storage = 7.3 * 5 = 36.5 PB
With replication = 36.5 * 3 = ~110 PB

Pattern 3: Bandwidth Estimation

Formula

Bandwidth = (QPS) x (Request Size or Response Size)

Example: Video streaming service

Given:
- 1 million concurrent viewers
- Average bitrate = 5 Mbps
- Peak hours: 8 PM - 11 PM

Bandwidth = 1M * 5 Mbps = 5 Tbps

With 20% overhead: ~6 Tbps

CDN egress cost (rough):
$0.02/GB * 6 Tbps * 3 hours * 3600 sec/hour / 8 bits/byte
= massive cost (hence why Netflix built their own CDN)

Pattern 4: Cache Size Estimation

Formula

Cache Size = (QPS) x (Cache TTL) x (Response Size) x (Unique Ratio)

Example: API response cache

Given:
- 10,000 QPS
- Cache TTL = 5 minutes = 300 seconds
- Average response = 10 KB
- 20% of requests are unique

Cache entries = 10,000 * 300 * 0.20 = 600,000 entries
Cache size = 600,000 * 10 KB = 6 GB

With overhead (keys, metadata): ~10 GB

Pattern 5: Database Sizing

Formula

DB Size = (Number of Rows) x (Row Size) x (Index Overhead) x (Replication)

Example: User profile database

Given:
- 500 million users
- Average profile = 1 KB (name, email, settings, etc.)
- Index overhead = 30%
- Primary + 2 replicas = 3x

Data size = 500M * 1 KB = 500 GB
With indexes = 500 GB * 1.3 = 650 GB
With replication = 650 GB * 3 = ~2 TB

Memory for hot data (20%): ~400 GB

Common Estimation Scenarios

Scenario 1: URL Shortener

Requirements:
- 100M new URLs/month
- 10:1 read:write ratio

Writes:
- 100M / (30 * 24 * 3600) = ~40 writes/second
- Peak: ~100 writes/second

Reads:
- 40 * 10 = 400 reads/second
- Peak: ~1000 reads/second

Storage (5 years):
- 100M URLs/month * 60 months = 6 billion URLs
- Average URL = 100 bytes (short) + 500 bytes (long) = 600 bytes
- 6B * 600 bytes = 3.6 TB
- With indexes and overhead: ~5 TB

Scenario 2: Chat Application

Requirements:
- 10M daily active users
- Average 50 messages sent/day
- Average 200 messages received/day

Message throughput:
- Sends: 10M * 50 / 86,400 = ~6,000 messages/second
- Peak: ~20,000 messages/second

Connections:
- Each user maintains 1-3 connections (phone, laptop, tablet)
- Peak concurrent: 10M * 0.1 (10% online) * 2 = 2M connections

Storage (1 year):
- 10M users * 50 msgs/day * 365 days = 182B messages/year
- Average message = 200 bytes
- 182B * 200 bytes = 36.4 TB/year

Scenario 3: Video Streaming

Requirements:
- 100M monthly active users
- 30% watch daily = 30M DAU
- Average 1 hour/day viewing

Concurrent viewers (peak):
- 30M DAU / 24 hours * 3 (peak factor) = ~4M concurrent

Bandwidth:
- Average stream: 5 Mbps
- 4M * 5 Mbps = 20 Tbps peak bandwidth

Storage (library of 10K titles):
- Average video = 2 hours
- Multiple qualities: 480p (1GB), 720p (3GB), 1080p (5GB), 4K (20GB)
- Per title: ~30 GB
- Library: 10K * 30 GB = 300 TB

Estimation Tips

Round Aggressively

Instead of:      Use:
86,400 seconds   ~100,000 (10^5)
2.5 million      ~3 million
7.3 petabytes    ~10 petabytes

Use Orders of Magnitude

Think in powers of 10:

  • Thousands (10^3)
  • Millions (10^6)
  • Billions (10^9)
  • Trillions (10^12)

State Your Assumptions

Always verbalize:

  • "I'm assuming 10% of users are active at peak"
  • "I'm estimating average message size at 200 bytes"
  • "I'm using a 3x replication factor"

Sanity Check Results

After calculating, ask:

  • "Does this make sense?"
  • "Is this in the right order of magnitude?"
  • "What would change if my assumption is off by 10x?"

Common Mistakes

Mistake 1: Ignoring Peak vs Average

Problem

Sizing for average load.

Average QPS: 10,000
Peak QPS: 30,000 (often 2-3x average)

If you size for 10,000, you'll fail at peak.

Mistake 2: Forgetting Replication

Problem

Calculating raw storage without copies.

Data: 1 TB
With 3 replicas: 3 TB
With backups: 4-5 TB

Mistake 3: Not Accounting for Growth

Problem

Sizing for current, not future.

Current users: 10M
Expected growth: 50%/year
Year 3: 10M * 1.5^3 = 34M users

Size for at least 2x current to avoid near-term issues.

Mistake 4: Over-Precision

Problem

Calculating to 3 decimal places.

Bad: "We need exactly 3,456,789 IOPS"
Good: "We need roughly 3-4 million IOPS"

Quick Reference Calculations

NeedFormula
QPSusers * actions/day / 86400
Storage/dayitems/day * size/item
BandwidthQPS * response_size
Cache hit rate1 - (DB_QPS / total_QPS)
Servers neededQPS / QPS_per_server
Shards neededdata_size / max_shard_size

Related Skills

  • design-interview-methodology - Overall interview framework
  • quality-attributes-taxonomy - NFR definitions (scalability, performance)
  • database-scaling - Database capacity planning (Phase 3)
  • caching-strategies - Cache sizing and hit rates (Phase 3)

Related Commands

  • /sd:estimate <scenario> - Calculate capacity interactively

Related Agents

  • capacity-planner - Guided estimation with calculations

References

  • references/latency-numbers.md - Complete latency reference table

Version History

  • v1.0.0 (2025-12-26): Initial release

Last Updated

Date: 2025-12-26 Model: claude-opus-4-5-20251101

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.23%
按下载量换算27

Claude

32.47%
按下载量换算27

Cursor

20.76%
按下载量换算17

Gemini CLI

10.4%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills