الملفات
ghaymah-exam-abdelaziz-sre/q4-scalability/calculations.md
2026-07-27 20:38:07 -04:00

59 أسطر
1.2 KiB
Markdown
خام اللوم التاريخ

هذا الملف يحتوي على أحرف Unicode غامضة

هذا الملف يحتوي على أحرف Unicode قد تُخلط مع أحرف أخرى. إذا كنت تعتقد أن هذا مقصود، يمكنك تجاهل هذا التحذير بأمان. استخدم زر الهروب للكشف عنها.

# Q4 - Scalability and Load Balancing
## 1. Architecture Overview
The application is deployed behind a Load Balancer that distributes incoming traffic across multiple application containers.
Components:
- Users
- Load Balancer
- Container Cluster
- Ghaymah Block Storage
- Database
---
## 2. Required Number of Containers
Application Load = 15,000 requests/second
One Container Capacity = 500 requests/second
Required Containers:
15000 / 500 = 30 Containers
Safety Margin (30%):
30 × 1.30 = 39 Containers
Final Answer:
**39 Containers**
---
## 3. Cold Start Strategy
To reduce cold start latency:
- Keep a small number of warm containers running.
- Enable Auto Scaling based on CPU and request rate.
- Perform health checks before routing traffic.
- Register new containers with the Load Balancer only after becoming healthy.
- Use lightweight container images for faster startup.
---
## 4. Ghaymah Block Storage
Block Storage is used for stateful workloads such as databases.
Benefits:
- Data persists even if containers restart.
- Supports high availability.
- Can be attached to replacement containers.
- Suitable for MySQL, PostgreSQL, MongoDB and other databases.