انتقل إلى المحتوى
أمين أبوزيد
SRC-004

تخطيط السعة

  • 8 درس
  • 5 ساعة تدريب (تقدير)
في هذه الصفحة 9 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • RPS
  • التزامن (concurrency)
  • نمو البيانات
  • الإنتاجية (throughput)
  • تقديرات التخزين

تعلّم أولًا

5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Derive peak RPS, concurrency, and data growth from business forecasts.
  2. Estimate storage, network, and compute needs with back-of-the-envelope calculations.
  3. Validate estimates with load-test data and identify headroom per component.
  4. Present a capacity plan with assumptions, margins, and triggers for re-planning.

الدروس

  1. 01من توقعات الأعمال إلى الحمل
  2. 02الذروات والموسمية وعوامل الاندفاع
  3. 03التقدير التقريبي السريع (Back-of-the-envelope)
  4. 04التخزين ونمو البيانات
  5. 05هامش السعة ونقاط التشبع
  6. 06خطط سعة يمكن للناس العمل بها
  7. 07عرض عملي: تحجيم النظام الفرعي للطلبات للجمعة البيضاء بعشرة أضعاف الحمل
  8. 08عرض عملي: مقارنة خطة سعة العام الماضي بالواقع

المختبر والتمارين

Lab

SRC-004-LAB1 · 10× capacity plan

Outcomes: 1–4 · Time: ~2.5 h

  1. Build the forecast chain from business numbers to peak RPS, concurrency, and write rate for orders, inventory, Kafka, and PostgreSQL.
  2. Estimate storage, network, and compute with multipliers (replication, retention, indexes).
  3. Compare with the MID load-test data; find saturation points and headroom per component, including N-1.
  4. Name the first bottleneck; write the plan with assumptions, margins, and re-planning triggers.

Acceptance: every number traceable to an assumption; first bottleneck named.

Exercises (timed estimation; six exercises)

IDOutcomeTask
SRC-004-EX011Finance forecasts 5x orders next year and 10x on Black Friday. Derive peak RPS from 150k orders/day, with explicit assumptions.
SRC-004-EX021Estimate concurrent users and database connections needed at that peak.
SRC-004-EX032Estimate yearly storage for an orders table (1 KB rows, 2M/day) with indexes, replicas, and backups.
SRC-004-EX042Estimate Kafka disk for 3,000 events/s of 1 KB, replication factor 3, 7-day retention.
SRC-004-EX053A load test shows PostgreSQL saturates at 4,000 TPS; peak need is 3,200 TPS with one replica lost. Compute headroom and decide.
SRC-004-EX064Write a re-planning trigger set for the plan.
أظهر الحلول
  • EX01 Peak hour 12% of day gives 18k orders/h, about 5 orders/s; 10x gives 50/s; at 25 requests per order that is about 1,250 RPS, with a burst factor of 2 giving about 2,500 RPS design peak. Show the assumptions.
  • EX02 Little's Law: concurrency = RPS x latency, so 2,500 x 0.1 s is about 250 in-flight requests; database connections depend on the share needing DB time and query time; verify with a pool model.
  • EX03 2M x 1 KB = 2 GB/day, about 730 GB/year; indexes x1.5 is about 1.1 TB; two replicas multiply to about 3.3 TB; add backups and WAL margin.
  • EX04 3,000 x 1 KB = 3 MB/s; x 86,400 s x 7 days is about 1.8 TB; x 3 replicas is about 5.4 TB cluster-wide.
  • EX05 Headroom at full capacity is 20%, but if the lost replica shifted load the effective capacity may drop; if 3,200 is within 80% of 4,000, there is no N-1 margin; plan read offload or scale-up before the peak.
  • EX06 For example: peak CPU above 60% for a week; storage projection reaches 70% in 90 days; requests per order drifts 20% from assumption; forecast revision from Finance.

Workplace evidence: a capacity estimate you produced and later compared with actual usage.

الاختبار

Outcomes: O1 forecast to load · O2 estimation · O3 validation and headroom · O4 plan and triggers.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1Why count requests per order?O1
  2. 2Sizing from the daily average:O1
  3. 3A burst factor is:O1
  4. 42 million rows a day of 1 KB is about:O2
  5. 5Which multiplier is often forgotten in Kafka storage?O2
  6. 6A back-of-the-envelope estimate should:O2
  7. 7The first bottleneck is the component with:O3
  8. 8N-1 headroom asks:O3
  9. 9A good re-planning trigger is:O4
  10. 10Validating an estimate best uses:O3

الجزء العملي

Six estimation exercises SRC-004-EX01 to EX06 (timed) plus the lab. Pass: quiz at least 8/10, at least five exercises within a factor of 2 of the reference with visible assumptions, and a plan with the first bottleneck named.

أخطاء شائعة

Averaging away peaks; forgetting replication and retention multipliers; no re-planning triggers.

التقييم

Timed estimation exercise.

دليل من بيئة العمل

A capacity estimate you produced and later compared with actual usage.

الصلة بالمسار الوظيفي

Large-scale performance (SRA-007) and cost architecture (ARC-021).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.