64 أسطر
1.2 KiB
Markdown
64 أسطر
1.2 KiB
Markdown
# 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
|