Логотип Sre Capacity And System Design

Sre Capacity And System Design

Спільнота
paulip114
sre-capacity-and-system-design

Use when designing or reviewing a distributed system for scale and resilience — NALSD capacity math, load balancing, load shedding, retries, deadlines, graceful degradation, cascading failures, simplicity, and distributed consensus for critical state. Based on Google SRE practice.

Огляд

Видавецьpaulip114
Репозиторійsre-practice-skills
Назва навичкиsre-capacity-and-system-design
Зірки
64
Форки
19
Файли в пакеті
1
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: paulip114. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Sre Capacity And System Design у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/paulip114/sre-practice-skills/tree/main/sre-capacity-and-system-design
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/paulip114/sre-practice-skills.git /tmp/sre-practice-skills
mkdir -p .claude/skills
cp -r /tmp/sre-practice-skills/sre-capacity-and-system-design .claude/skills/sre-capacity-and-system-design
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Sre Capacity And System Design в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Sre Capacity And System Design, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Sre Capacity And System Design не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Capacity, Overload and Reliable System Design

Design with real numbers, survive the loss of your largest failure domain, and make every component degrade gracefully instead of collapsing under load.

Overload and Cascading Failures

A cascading failure is one that grows by positive feedback: one part fails, its load moves to the rest, which then fails too. Most are driven by overload, so the defense is to make every service degrade gracefully instead of falling over.

How cascades happen

  • Server overload → slower responses → more concurrent requests → more memory/CPU → slower still.
  • Resource exhaustion: CPU (queues grow), memory (GC thrash, OOM kills), threads, file descriptors, connection pools.
  • Retry amplification: every layer retries, multiplying load on the struggling backend.
  • Crash loops / health-check churn: overloaded tasks fail health checks, get removed, pushing more load onto survivors.
  • Slow startup / cold caches: restarted tasks can't take full load yet.
  • Triggers: traffic spikes, a lost cluster/zone, bad releases, cache flushes, batch jobs, a planned change that reduces capacity.

Defenses (design time)

  1. Load-test to find the limit and how the service fails beyond it. Know which resource runs out first. A service should keep serving at its capacity under excess load, not collapse.
  2. Load shedding: reject excess requests early and cheaply (based on concurrent requests, queue length or CPU) with an explicit "overloaded" error. Keep queues short — a long queue just adds latency.
  3. Graceful degradation: serve cheaper results (cached, partial, lower quality) when overloaded. Make degraded mode easy to trigger and test it regularly.
  4. Request criticality: tag requests (e.g. critical-plus, critical, sheddable-plus, sheddable) and propagate the tag; shed least critical first. Batch and prefetch traffic should be sheddable.
  5. Retries done right:
    • Exponential backoff with jitter.
    • Per-request retry cap (e.g. 3 attempts).
    • A retry budget per client (e.g. retries ≤ ~10% of requests); stop retrying when exceeded.
    • Retry at one layer only; lower layers return "overloaded, don't retry" so the error doesn't fan out.
  6. Deadlines: every request carries a deadline, propagated (minus elapsed time) to downstream calls. Servers drop work whose deadline has already passed. Beware deadlines set far longer than useful.
  7. Client-side adaptive throttling: clients track requests vs. accepted responses over a recent window and reject locally with probability ≈ max(0, (requests − K·accepts) / (requests + 1)), with K ≈ 2. This stops wasted work at the source when the backend is rejecting.
  8. Load balancing: at the frontend, steer users by proximity and capacity (DNS, anycast, L7). In the datacenter, use subsetting (each client talks to a bounded subset of backends) and balancing on load signals (e.g. weighted round robin or least-loaded), not naive round robin.
  9. Capacity planning: provision for peak plus headroom for losing your largest failure domain (N+2 is common); forecast organic growth and launches; autoscaling with sensible min/max, scaling on the right signal, and awareness that scaling a frontend can overload a backend.
  10. Avoid dangerous behaviors: don't fail health checks just because you're busy; make startup fast and warm caches gradually; avoid synchronized clients (jitter cron and retries); test the full-cluster-loss scenario.

Recovery playbook (during an overload incident)

  1. Stop the feedback loop first: increase capacity if possible, but more importantly reduce load.
  2. Shed or block load: drop sheddable/batch traffic, rate-limit or block the abusive or misbehaving client, turn on degraded mode.
  3. Stop retries amplifying (disable client retries, raise backoff).
  4. Stop health-check churn if it is killing tasks that could serve.
  5. Restart carefully in stages, letting caches warm, rather than all at once.
  6. Add traffic back gradually, watching saturation.
  7. Afterwards: postmortem, with load test and degradation work as action items.

Review checklist for a service

  • Known capacity per task and per cluster, from load tests, with the limiting resource identified?
  • Behavior beyond capacity tested — sheds instead of collapsing?
  • Deadlines set and propagated; expired work dropped?
  • Retries bounded per request and per client, at one layer, with backoff + jitter?
  • Request criticality defined and used for shedding?
  • Degraded mode exists and is exercised?
  • Capacity covers peak with loss of the largest failure domain?
  • Health checks distinguish "dead" from "busy"?

Reliable System Design Review

Non-abstract large system design (NALSD)

Design iteratively and make every design concrete: put real numbers on it and check it would fit on real machines and networks. An elegant abstract design that needs 10× the hardware you have is not a design.

Procedure
  1. Clarify requirements. Users, operations (reads/writes), data size, request rate, latency and availability SLOs, consistency needs, growth over 1–3 years.
  2. Is it possible at all? Sketch the simplest design ignoring scale (one machine). Does it meet functional requirements?
  3. Can we do better? Improve the algorithm/data layout before adding machines (e.g. O(n) → O(log n), precompute, index).
  4. Make it scale. Distribute: shard, replicate, cache, batch. For each component, calculate:
    • Peak QPS (incl. growth and a safety factor), per-request CPU, memory, disk and network cost.
    • Storage size including replication and indices.
    • Number of machines = max over resources of (demand ÷ per-machine capacity), plus headroom.
    • Latency budget across hops vs. the SLO. Use references/estimation-cheatsheet.md for back-of-envelope numbers.
  5. Make it reliable. Place replicas across failure domains (machine, rack, zone, region); provision N+2 for the largest domain; decide degradation behavior when a component is lost.
  6. Iterate. Re-run the numbers after each change; record assumptions so they can be checked against reality later (load tests, production metrics).

Output a bill of materials (machines/resources per component per region) and the assumptions behind it.

Simplicity review

Complexity is the enemy of reliability. Distinguish essential complexity (inherent in the problem) from accidental complexity (from our solutions), and attack the latter.

Ask in review:

  • Can the design be explained in a few sentences and a single diagram?
  • Is every component, flag, and option needed now? Remove unused code and features ("negative lines of code" are a win).
  • Are APIs minimal and hard to misuse? Are modules loosely coupled with clear ownership?
  • Are releases small and frequent rather than large and rare?
  • Is the system boring in the good sense — predictable, using well-understood technology?
  • Track complexity over time (number of dependencies, config knobs, services); push back when it grows without need.

Critical state and distributed consensus

For state that must be consistent across replicas (leader election, locks, configuration, metadata, queues that must not lose or duplicate work):

  • Use a proven consensus system (Paxos/Raft-based: e.g. etcd, ZooKeeper, Spanner-like stores) instead of ad-hoc heartbeats or "whoever writes last wins". Heartbeat-based leader election suffers split-brain under network partitions.
  • Understand the trade-off (CAP): under partition you choose between availability and consistency — for critical state, choose consistency.
  • Performance: consensus needs a quorum round-trip per write; place replicas so a quorum is close together for latency, while still spread enough to survive the failure domains you care about. Typically 5 replicas tolerate 2 failures; 3 tolerate 1.
  • Batch and pipeline proposals to increase throughput; serve reads from leader leases or followers only when stale reads are acceptable.
  • Monitor: number of healthy replicas, leader changes, proposal latency, lagging replicas, quorum loss risk.
  • Keep the consensus system small and dedicated; put bulk data elsewhere and store only pointers/metadata in it.

Review checklist

  • Requirements quantified (QPS, data size, SLOs, growth)?
  • Capacity math shown per component, with assumptions written down?
  • Failure domains identified; design survives loss of largest one at peak?
  • Critical state handled by a consensus system, with replica placement justified?
  • Degradation plan when a dependency fails?
  • Accidental complexity challenged; the simplest workable design chosen?

Sources

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Sre Capacity And System Design?

Use when designing or reviewing a distributed system for scale and resilience — NALSD capacity math, load balancing, load shedding, retries, deadlines, graceful degradation, cascading failures, simplicity, and distributed consensus for critical state. Based on Google SRE practice.

Навіщо використовувати Sre Capacity And System Design у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Sre Capacity And System Design — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Sre Capacity And System Design у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/paulip114/sre-practice-skills/tree/main/sre-capacity-and-system-design. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Sre Capacity And System Design?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Sre Capacity And System Design?

Зі скількома забажаєте. У TypingMind ви можете використовувати Sre Capacity And System Design із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Sre Capacity And System Design?

Так. На GitHub цю навичку публікує paulip114 за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі
Логотип openclaw

Openclaw Ci Limits

openclaw
ОрганізаціяПопулярне

Керуйте GitHub Actions для OpenClaw і пропускною здатністю CI у Blacksmith, бюджетами реєстрації раннерів, обмеженнями fanout, одночасним запуском лише одного завдання для кожного push у main, розміром шард, перенесенням завдань на хостовані раннери, станом черги та безпечним…

82.2K
391K
Файлів: 1
Відкрити
Логотип openclaw

Openclaw Testing

openclaw
ОрганізаціяПопулярне

Добирайте пропорційні за обсягом тести й перевірки OpenClaw, діагностуйте помилки та передавайте завдання, чутливі до середовища, або підтвердження для релізу відповідальним особам.

82.2K
391K
Файлів: 2
Відкрити
Логотип mattpocock

Wizard

mattpocock
СпільнотаПопулярне

Створює інтерактивний майстер у bash, який проводить людину через кроки, доступні лише їй. Використовуйте його для підготовки інфраструктури, налаштування облікових даних або секретів CI, роботи з незнайомою…

22.3K
264.4K
Файлів: 2
Відкрити
Логотип affaan-m

Deployment Patterns

affaan-m
СпільнотаПопулярне

Процеси розгортання, шаблони конвеєрів CI/CD, контейнеризація Docker, перевірки працездатності, стратегії відкату та контрольні списки готовності вебзастосунків до промислового…

39.1K
261.1K
Інструкції
Відкрити

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇