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

نمذجة الأداء

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

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

نظرة عامة

الموضوعات

  • ميزانيات زمن الاستجابة (Latency budgets)
  • قانون Little
  • تحليل الاختناقات
  • نظرية الطوابير (queuing)

تعلّم أولًا

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

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

  1. Allocate an end-to-end latency budget across components and calls.
  2. Apply Little's Law to relate throughput, latency, and concurrency (threads, connections, consumers).
  3. Explain queueing behavior near saturation and why latency explodes at high utilization.
  4. Identify the bottleneck resource from a model and confirm it experimentally.

الدروس

  1. 01ميزانيات زمن الاستجابة
  2. 02قانون Little
  3. 03الطوابير والاستخدام
  4. 04زمن الاستجابة الطرفي (Tail latency) والتوزيع الموسّع (fan-out)
  5. 05إيجاد الاختناق على الورق
  6. 06عرض عملي: التنبؤ بأحجام المجمّعات (pools) بقانون Little ثم القياس

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

Lab

SRC-005-LAB1 · Checkout latency budget

Outcomes: 1–4 · Time: ~2.5 h

  1. Allocate a p99 budget for checkout across the services and calls on the critical path.
  2. Model required HTTP threads, DB connections, and Kafka consumers with Little's Law at the 10× load.
  3. Compute utilization per resource on paper and name the predicted bottleneck.
  4. Verify with a load test; compare model and measurement.

Acceptance: model within 20% of measurement or discrepancy explained.

Exercises (modeling problem set; six exercises)

IDOutcomeTask
SRC-005-EX011Allocate a 900 ms p99 budget over a path with gateway, order, two parallel calls (inventory, pricing), then payment, then DB write.
SRC-005-EX022800 requests/s at 150 ms: how many in flight? A pool has 60 connections: what is the maximum throughput at 30 ms per query?
SRC-005-EX033Explain why a service at 90% utilization shows much higher p99 than at 60%, and propose two protections.
SRC-005-EX043Latency of a downstream call rises from 50 ms to 500 ms at constant arrival rate. What happens to threads in flight?
SRC-005-EX054From a table of resource demand and capacity, identify the bottleneck and design an experiment to confirm it.
SRC-005-EX061A page calls 20 services in parallel, each with p99 100 ms and p50 10 ms. Estimate how often the page sees a slow call and suggest a fix.
أظهر الحلول
  • EX01 Parallel calls count as the maximum: gateway 20, order 100, parallel max(150, 80) = 150, payment 350, DB 100, margin 70 ms = 790 ms plus reserve; state timeouts per call.
  • EX02 800 x 0.15 = 120 in flight. Pool throughput = 60 / 0.03 = 2,000 queries/s.
  • EX03 Queueing delay grows steeply near saturation; protections: bounded queues with load shedding, autoscaling or capacity headroom, timeouts.
  • EX04 In flight = rate x latency, so concurrency grows ten times; pools exhaust and requests queue unless timeouts and limits cap it.
  • EX05 Highest utilization resource (for example DB pool at 92%) is the candidate; raise load stepwise, watch pool wait time and CPU, then change pool size and see whether the knee moves.
  • EX06 1 - 0.99^20 is about 18% of pages see a slow call; fix with fewer calls, caching, timeouts with degraded fallback, hedged requests.

Workplace evidence: a performance target you set or met using a model rather than trial and error.

الاختبار

Outcomes: O1 latency budgets · O2 Little's Law · O3 queueing near saturation · O4 finding the bottleneck.

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

  1. 1Sequential calls in a budget:O1
  2. 2Parallel calls contribute to latency as:O1
  3. 3A budget should be based on:O1
  4. 4Little's Law is:O2
  5. 5400 requests/s at 0.25 s each means about how many in flight?O2
  6. 6Near saturation, waiting time:O3
  7. 7A protection against queue-driven latency:O3
  8. 8With 10 parallel calls each slow 1% of the time, requests hitting a slow call are about:O3
  9. 9The bottleneck candidate on paper is the resource with:O4
  10. 10After a model predicts a bottleneck, you should:O4

الجزء العملي

Six modeling problems SRC-005-EX01 to EX06 plus the lab. Pass: quiz at least 8/10, at least five problems correct, and a model within 20% of the load-test measurement or an explained discrepancy.

أخطاء شائعة

Budgets based on averages; ignoring fan-out amplification of tail latency.

التقييم

Modeling problem set.

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

A performance target you set or met using a model rather than trial and error.

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

Performance engineering (SRC-016).

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