2.7 KiB
2.7 KiB
Reference: EC2 Instance Type Mapping
Tabella completa di mapping tra Docker resource limits e EC2 instance types.
Tabella di Mapping Completa
| Docker Compose | EC2 Instance | vCPUs | Memory | Costo/ora* | Use Case |
|---|---|---|---|---|---|
cpus: '0.5'memory: 512M |
t2.nano | 0.5 | 512 MB | $0.006 | Microservizi minimi |
cpus: '1'memory: 1G |
t2.micro | 1 | 1 GB | $0.012 | Dev/Test |
cpus: '1'memory: 2G |
t2.small | 1 | 2 GB | $0.024 | Web server |
cpus: '2'memory: 4G |
t2.medium | 2 | 4 GB | $0.048 | Application |
cpus: '2'memory: 8G |
m5.large | 2 | 8 GB | $0.096 | Production |
cpus: '4'memory: 16G |
m5.xlarge | 4 | 16 GB | $0.192 | High traffic |
cpus: '8'memory: 32G |
m5.2xlarge | 8 | 32 GB | $0.384 | Scalabile |
cpus: '16'memory: 64G |
m5.4xlarge | 16 | 64 GB | $0.768 | Enterprise |
*Costi indicativi per regione us-east-1
Famiglie Instance Types
General Purpose (m5, m6)
Equilibrato tra CPU, memoria, rete.
# m5.large - 2 vCPUs, 8 GB
cpus: '2'
memory: 8G
Use case: Web server, application server
Burstable (t2, t3)
Credit-based CPU, basso costo.
# t2.micro - 1 vCPU, 1 GB
cpus: '1'
memory: 1G
Use case: Dev, test, microservizi
Compute Optimized (c5, c6)
Alto ratio CPU/memoria.
# c5.xlarge - 4 vCPUs, 8 GB
cpus: '4'
memory: 8G
Use case: Batch processing, encoding
Memory Optimized (r5, r6)
Alto ratio memoria/CPU.
# r5.large - 2 vCPUs, 16 GB
cpus: '2'
memory: 16G
Use case: Database, caching
Docker Compose Examples
T2 Nano (Micro)
micro:
image: alpine:3.19
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
T2 Micro (Dev/Test)
dev:
image: node:alpine
deploy:
resources:
limits:
cpus: '1'
memory: 1G
T2 Small (Web)
web:
image: nginx:alpine
deploy:
resources:
limits:
cpus: '1'
memory: 2G
T2 Medium (Application)
app:
image: python:alpine
deploy:
resources:
limits:
cpus: '2'
memory: 4G
M5 Large (Production)
production:
image: nginx:alpine
deploy:
resources:
limits:
cpus: '2'
memory: 8G
Shortcut Reference
Quick Copy-Paste
# T2 Nano
cpus: '0.5'; memory: 512M
# T2 Micro
cpus: '1'; memory: 1G
# T2 Small
cpus: '1'; memory: 2G
# T2 Medium
cpus: '2'; memory: 4G
# M5 Large
cpus: '2'; memory: 8G
# M5 XLarge
cpus: '4'; memory: 16G
Vedi Anche
- Tutorial: Configurare Limiti delle Risorse
- How-to: Selezionare Instance Type
- Explanation: Compute-EC2 Parallels