Use ARM instances: Graviton (AWS) / T2A (GCP) are 20% cheaper with same or better performance.
TCO Comparison: Self-Hosted vs Cloud
Factor
VPS ($40/mo)
AWS (equivalent)
Self-Hosted
Compute
$40/mo
$70-150/mo
$500 one-time + power
Database
Included (self-managed)
$30-100/mo (RDS)
Included
Bandwidth
Usually generous
$0.09/GB out (adds up!)
ISP cost
Your time
Medium (manage server)
Low (managed services)
High (manage everything)
Scaling
Manual (resize/add VPS)
Automatic
Buy more hardware
Reliability
99.9% SLA typical
99.99% possible
Depends on you
Billing Alerts
# AWS: Set up billing alarm via CLI
aws cloudwatch put-metric-alarm \
--alarm-name "MonthlyBillingAlarm" \
--alarm-description "Alert when bill exceeds $100" \
--metric-name EstimatedCharges \
--namespace AWS/Billing \
--statistic Maximum \
--period 21600 \
--threshold 100 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 1 \
--alarm-actions arn:aws:sns:us-east-1:ACCOUNT:billing-alerts \
--dimensions Name=Currency,Value=USD
# Also set alerts at 50%, 80%, 100% of budget
# AWS Budgets is more powerful than CloudWatch for this
The hidden costs of cloud:
• Data transfer out: AWS charges $0.09/GB. A site serving 1TB/month = $90 just in bandwidth.
• NAT Gateway: $0.045/hr + $0.045/GB processed. Can easily be $30-100/mo.
• Load Balancer: $16-25/mo minimum even with zero traffic.
• Managed databases: 3-5x the cost of self-managed on a VPS.
Mitigation: Use Cloudflare (free CDN, absorbs bandwidth), minimize NAT Gateway usage, consider Hetzner/DO for predictable pricing.