Multi-tenant architectures let you serve many customers from shared infrastructure, which naturally drives down per-tenant costs. But once you hit production scale, you'll notice something: some tenants use way more than others, and your AWS bill doesn't reflect that fairly. Here's how to fix that.
1. Right-Size Your Compute Fleet
The biggest line item in most AWS bills is EC2 or ECS/Fargate compute. In multi-tenant setups, it's tempting to over-provision to handle the loudest tenant. Don't.
Use Auto Scaling with custom metrics. Standard CPU-based scaling misses tenant behavior. Instead, instrument your application to emit per-tenant request counts or queue depth, and scale on those metrics. If Tenant A sends 10x the traffic, your pool should grow to serve them without dragging Tenant B along for the ride.
Consider per-tenant instance sizing. If you have enterprise tenants who pay for guaranteed performance, give them dedicated instance types (like r6i.xlarge) while keeping startup tenants on shared Spot instances with capacity groups. The cost differential is significant — Spot can be 60-70% cheaper.
2. Separate State from Compute
One common anti-pattern in multi-tenant apps is coupling tenant data to the same RDS or ElastiCache cluster that serves your application code. This forces you to size the database for peak tenant activity, even when most tenants are idle.
Database-per-tenant or connection pooling. For high-compliance or high-usage tenants, dedicated RDS instances make sense. For everyone else, implement PgBouncer or Redis connection pooling to multiplex connections across tenants efficiently. You can run one large database instance instead of many small ones.
S3 for bulk storage. If tenants upload files, documents, or blobs, use S3 with per-tenant prefixes rather than storing in the database. S3 costs are predictable and cheap — and you can use lifecycle policies to move older data to Glacier or Intelligent-Tiering automatically.
3. Implement Usage-Based Reservations
On-demand pricing kills multi-tenant margins. Most multi-tenant apps have predictable baseline usage.
Buy Reserved Instances or Savings Plans for your baseline. If you run 10 t3.medium instances 24/7, commit to a 1-year Savings Plan. You'll save 30-40% instantly. The remaining burst capacity above baseline can run on Spot.
Use Savings Plans, not RI. RI flexibility is limited, and RI management is overhead you don't need. Savings Plans give you the discount with less commitment headaches.
4. Tag Everything and Bill Back
If you don't know which tenant costs what, you can't optimize. AWS's granular billing is your friend.
Tag every resource by tenant ID. Tag your EC2 instances, RDS databases, Lambda functions, and NAT Gateway traffic. Use TenantId: acme-corp or TenantId: startup-plan.
Use Cost Explorer with tags. Build a simple dashboard showing cost-per-tenant. When Tenant X shows $800/month and Tenant Y shows $50, you can have the pricing conversation or find optimization opportunities for the heavy user.
5. Watch the Hidden Costs
The obvious AWS services get attention, but the hidden costs add up:
- NAT Gateway: If tenants make lots of outbound API calls, NAT Gateway data processing fees stack up. Consider VPC endpoints for AWS services, and cache aggressively.
- CloudWatch Logs: Ingesting and storing logs for inactive tenants is wasteful. Set expiration policies aggressively, or use CloudWatch Logs Insights with query-based retrieval instead of constant streaming.
- Data Transfer: Cross-AZ traffic, public IP egress, and inter-region traffic all cost. Keep tenant workloads in the same AZ where possible.
6. Schedule Non-Production Environments
If you have staging, QA, or demo environments running 24/7, you're wasting money. Most teams only use these 8-10 hours a day.
Use Lambda or EventBridge to start/stop non-prod instances on a schedule. You can cut that environment's compute bill by 60%+ with zero impact on your workflow.
The Bottom Line
Multi-tenant cost optimization isn't about cutting corners — it's about matching cost to value. The tenants who use more should bear more of the infrastructure cost. The strategies above let you do that while keeping shared infrastructure efficient for everyone.
Start with tagging and cost visibility — you can't optimize what you can't measure. Then move to right-sizing and reservation strategies. Those three steps alone typically cut 20-30% off a growing multi-tenant AWS bill.