Complete Ghaymah SRE Technical Assessment
هذا الالتزام موجود في:
21
q4-scalability/architecture.md
Normal file
21
q4-scalability/architecture.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Application Architecture
|
||||
|
||||
Internet
|
||||
|
|
||||
|
|
||||
+---------------+
|
||||
| Load Balancer |
|
||||
+---------------+
|
||||
|
|
||||
-----------------------------------------
|
||||
| | |
|
||||
+---------------+ +---------------+ +---------------+
|
||||
| Container #1 | | Container #2 | | Container #3 |
|
||||
| 500 req/s | | 500 req/s | | 500 req/s |
|
||||
+---------------+ +---------------+ +---------------+
|
||||
| | |
|
||||
-----------------------------------------
|
||||
|
|
||||
+----------------+
|
||||
| Block Storage |
|
||||
+----------------+
|
||||
63
q4-scalability/calculations.md
Normal file
63
q4-scalability/calculations.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Scalability Calculations
|
||||
|
||||
## Requirements
|
||||
|
||||
- Expected Traffic: 15,000 requests/second
|
||||
- Capacity per Container: 500 requests/second
|
||||
- Safety Margin: 30%
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Calculate Required Containers
|
||||
|
||||
15000 ÷ 500 = 30 Containers
|
||||
|
||||
---
|
||||
|
||||
## Step 2: Add Safety Margin
|
||||
|
||||
30 × 30% = 9 Containers
|
||||
|
||||
---
|
||||
|
||||
## Total Containers
|
||||
|
||||
30 + 9 = **39 Containers**
|
||||
|
||||
The application should start with 39 containers to handle the expected traffic safely.
|
||||
|
||||
|
||||
---
|
||||
|
||||
# Cold Start Strategy
|
||||
|
||||
To reduce cold start time:
|
||||
|
||||
- Keep a minimum of 2 containers always running.
|
||||
- Use lightweight Docker images.
|
||||
- Pre-pull container images on worker nodes.
|
||||
- Configure Horizontal Pod Autoscaler (HPA).
|
||||
- Enable readiness probes before sending traffic to new containers.
|
||||
|
||||
This strategy reduces startup delay and improves application availability during traffic spikes.
|
||||
|
||||
|
||||
---
|
||||
|
||||
# Using Ghaymah Block Storage
|
||||
|
||||
Block Storage provides persistent storage for applications that need to keep data even if containers are restarted or replaced.
|
||||
|
||||
Common use cases:
|
||||
|
||||
- Databases (PostgreSQL, MySQL)
|
||||
- Application logs
|
||||
- User uploaded files
|
||||
- Backup data
|
||||
|
||||
Benefits:
|
||||
|
||||
- Persistent storage
|
||||
- High availability
|
||||
- Data remains available after container restarts
|
||||
- Easy to attach to new containers
|
||||
المرجع في مشكلة جديدة
حظر مستخدم