diff --git a/q4-scalability/README.md b/q4-scalability/README.md index 20aa904..c8307f5 100644 --- a/q4-scalability/README.md +++ b/q4-scalability/README.md @@ -19,39 +19,38 @@ ▼ ▼ [ Ghaymah In-Memory Cache ] [ Ghaymah Stateful Workloads ] (Redis Cluster for Sessions) (StatefulSet + Ghaymah Block Storage) -2. Container Sizing & Capacity Calculations -Target Throughput: 15,000 req/s +``` -Max Throughput per Container: 500 req/s +--- -Base Container Requirement: +## 2. Container Sizing & Capacity Calculations -Base Containers = 15,000 / 500 = 30 containers +- **Target Throughput:** 15,000 req/s +- **Max Throughput per Container:** 500 req/s +- **Base Container Requirement:** + - Base Containers = 15,000 / 500 = **30 containers** -Safety Margin Buffer (30% Overhead): +- **Safety Margin Buffer (30% Overhead):** + - **Option A (Adding 30% extra capacity):** 30 x 1.30 = **39 containers** + - **Option B (Targeting 70% max utilization per container):** 15,000 / 350 = 42.85 -> **43 containers** -Option A (Adding 30% extra capacity): 30 x 1.30 = 39 containers +**Deployment Recommendation:** Set initial HPA baseline to **40 replicas** with auto-scaling limits between **39 to 60 containers**. -Option B (Targeting 70% max utilization per container): 15,000 / 350 = 42.85 -> 43 containers +--- -Deployment Recommendation: Set initial HPA baseline to 40 replicas with auto-scaling limits between 39 to 60 containers. +## 3. Cold Start Mitigation Strategy for New Containers -3. Cold Start Mitigation Strategy for New Containers To eliminate container startup latency during burst auto-scaling events: +1. **Lightweight Container Images:** Use minimal multi-stage Docker builds (Alpine/Distroless) to reduce pull and extraction time. +2. **Kubernetes Readiness & Startup Probes:** Separate heavy initialization from readiness checks so traffic is routed only when application memory is warm. +3. **Pre-warmed Buffer Capacity:** Configure HPA with a conservative scale-down stabilization window and preemptive predictive scaling. +4. **Lazy Initialization:** Defer non-critical background module loading until after the main web server accepts requests. -Lightweight Container Images: Use minimal multi-stage Docker builds (Alpine/Distroless) to reduce pull and extraction time. +--- -Kubernetes Readiness & Startup Probes: Separate heavy initialization from readiness checks so traffic is routed only when application memory is warm. +## 4. Ghaymah Block Storage for Stateful Workloads -Pre-warmed Buffer Capacity: Configure HPA with a conservative scale-down stabilization window and preemptive predictive scaling. - -Lazy Initialization: Defer non-critical background module loading until after the main web server accepts requests. - -4. Ghaymah Block Storage for Stateful Workloads Ghaymah Block Storage provides low-latency, high-IOPS persistent storage for stateful applications (Databases, Message Queues): - -PersistentVolumeClaims (PVC): Dynamically provisions dedicated block volumes attached directly to Kubernetes StatefulSet pods. - -Data Consistency & Isolation: High-performance storage isolated per database instance (e.g., PostgreSQL / MongoDB data directories). - -Snapshot & Disaster Recovery: Enables automated point-in-time volume snapshots without service interruption. +1. **PersistentVolumeClaims (PVC):** Dynamically provisions dedicated block volumes attached directly to Kubernetes StatefulSet pods. +2. **Data Consistency & Isolation:** High-performance storage isolated per database instance (e.g., PostgreSQL / MongoDB data directories). +3. **Snapshot & Disaster Recovery:** Enables automated point-in-time volume snapshots without service interruption.