انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-017-L03

تحديد حجم المجمّع

  • الدرس 3 من 5
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

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

في هذا الدرس

size a pool from capacity, not by guesswork.

الموضوعات المخطط لها

  • Start with the database: total connections across all app instances must stay under what the server can serve (cores and disks, and max_connections).
  • A common starting rule: connections ≈ (core_count × 2) + effective_spindle_count; treat it as a start, then measure.
  • Little's law: concurrent connections needed ≈ requests per second × average time a connection is held.
  • Multiply the pool by the number of app instances; autoscaling can overload the database.
  • Shorter transactions need fewer connections; fix slow queries before enlarging the pool.
تفاصيل المخطط المبدئي

عرض عملي

a worked example: 400 req/s × 25 ms hold = 10 connections on average; add headroom; three instances means 4–6 per instance.

اختبر فهمك

200 req/s, each holds a connection 50 ms. About how many connections are busy on average?

أظهر الإجابة

10.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

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

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

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