عرض عملي: الخيوط الأساسية مقابل الافتراضية تحت الحِمل
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
measure the effect on Shop's slow-supplier endpoint; prepares MID-007-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Start Shop with 200 platform request threads; the endpoint calls a supplier with 500 ms latency and one DB query.
- Run a load test with 1,000 concurrent clients; record throughput, p95 latency, and pool metrics.
- Enable virtual threads, restart, and repeat.
- Observe higher throughput, then database pool saturation (connections pending).
- Planned mistake: also raise the DB pool to 1,000 "to fix it" and hit database limits. Fix: keep a sized pool or a
Semaphoreguard; accept queueing in the right place. - Summarize: the bottleneck moved from threads to the database.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.