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

اختبار الأداء

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

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

نظرة عامة

الموضوعات

  • k6 أو Gatling
  • اختبار الحِمل (load)
  • الإجهاد (stress)
  • الذروة المفاجئة (spike)
  • الاختبار الممتد (soak)

تعلّم أولًا

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

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

  1. Distinguish load, stress, spike, and soak tests and what each reveals.
  2. Write k6 (or Gatling) scenarios with realistic traffic mixes and think time.
  3. Report latency percentiles and throughput, and avoid coordinated omission.
  4. Correlate test results with profiles and metrics to find the bottleneck.

الدروس

  1. 01أنواع اختبارات الأداء
  2. 02كتابة سيناريوهات k6
  3. 03نماذج حِمل العمل
  4. 04النسب المئوية (Percentiles) والإغفال المنسّق
  5. 05من نتيجة الاختبار إلى نقطة الاختناق
  6. 06عرض عملي: اختبار ممتد يكشف تسرّبًا بطيئًا

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

Lab

MID-046-LAB1 · Shop under load

Outcomes: 1–4 · Time: ~3 h Run load, spike, and 2-hour soak tests of checkout from a separate machine with a realistic traffic mix and data set. Write a report naming the first bottleneck. Acceptance: report with percentiles, graphs, and evidence.

Exercises (assessment: report review)

IDOutcomeTask
MID-046-EX011For four scenarios (flash sale, nightly leak, capacity planning, recovery after overload), pick the test type and justify it.
MID-046-EX022Write a k6 script for browse, add to cart, and checkout with think time and thresholds.
MID-046-EX032Make the script use varied users and SKUs from a data file.
MID-046-EX043Rewrite a closed-loop scenario as an arrival-rate scenario and explain the change in the results.
MID-046-EX053Given a latency histogram, report p50, p95, p99 and explain why the average misleads.
MID-046-EX064Given a graph of p95 and pool-wait metrics, state the bottleneck hypothesis and the next measurement.
MID-046-EX071–4Review a sample report: list what is missing (percentiles, load generator location, data realism, evidence).
أظهر الحلول
  • EX01 Flash sale: spike; nightly leak: soak; capacity planning: stress or load to saturation; recovery: stress with a drop back to normal.
  • EX02 options.thresholds for p95 and failure rate; a default function with three requests and sleep calls.
  • EX03 SharedArray loaded from JSON/CSV and a random pick per iteration.
  • EX04 executor: 'constant-arrival-rate' with preAllocatedVUs; the slow system now shows rising latency and dropped iterations instead of hidden lower throughput.
  • EX05 State the three percentiles; the average sits between them and hides the tail.
  • EX06 Hypothesis: connection pool saturation; measure pool wait, active connections, and slow queries; then retest after adjusting one setting.
  • EX07 Missing items are fixed one by one; reject reports that quote only averages or ran on the same machine as the system under test.

Outcome 1 is also checked by the lab (three test types) and quiz Q01-Q02.

الاختبار

Outcomes: O1 test kinds · O2 k6 scenarios and workloads · O3 percentiles and coordinated omission · O4 finding the bottleneck.

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

  1. 1Which test finds slow leaks?O1
  2. 2A spike test simulates:O1
  3. 3In k6, thresholds are used to:O2
  4. 4Think time (sleep) is added because:O2
  5. 5For public web traffic the better model is:O2
  6. 6Average latency is a poor summary because:O3
  7. 7Coordinated omission means:O3
  8. 8Percentiles from several machines should be:O3
  9. 9After finding a bottleneck you should:O4
  10. 10The load generator should run:O4

الجزء العملي

Seven exercises MID-046-EX01 to EX07 plus the load, spike, and soak lab. Pass: at least five exercises and a report with percentiles, graphs, and evidence of the first bottleneck.

أخطاء شائعة

Averages instead of percentiles; testing from the same machine; unrealistic data sets.

التقييم

Report review.

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

Capacity planning (SRC-004) and the MID gate.

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