Private Client · Europe
Cutting Azure Cloud Cost by 60% While Improving Performance 10x
Their Azure bill was €180K/month and their API was slow. We cut the bill to €72K and made the API 10x faster. Here's exactly what we changed.
Measured results
- Monthly Azure cost reduced from €180K to €72K (60% reduction)
- Slowest API endpoint improved from 4.2s to 380ms (10x faster)
- Zero downtime during optimization
- Performance improvements verified with load testing
Challenge
The blocker
A SaaS company's Azure bill had grown to €180,000/month, and their slowest API endpoint took 4.2 seconds to respond. They were paying more and getting worse performance.
Solution
The approach
We audited their Azure resources, right-sized underutilized services, moved to consumption-based plans, optimized database queries, and implemented caching. The result: 60% cost reduction and 10x performance improvement.
Execution story
The CTO showed us the Azure bill. €180,000 per month. For a SaaS company with 40 employees and 2,000 customers, that was way too much. The previous team had over-provisioned everything "to be safe" and nobody had ever gone back to right-size.
Then she showed us the performance dashboard. Their slowest API endpoint — the one that loaded a customer's order history — took 4.2 seconds on average. Users had complained. The team's response was to scale up the database. That made it slightly faster and the bill slightly bigger.
They were paying more and getting worse performance. Something was fundamentally wrong.
The audit (week 1)
We started with a full inventory of every Azure resource in their subscription. The picture wasn't pretty.
| Resource | Count | Monthly Cost | Avg CPU Utilization |
|---|---|---|---|
| App Service (P3v2) | 8 | €32,000 | 12% |
| SQL Database (S4) | 4 | €48,000 | 8% |
| Redis Cache (P2) | 2 | €12,000 | 3% |
| Virtual Machines (D4v2) | 6 | €24,000 | 15% |
| Storage Accounts | 12 | €8,000 | N/A |
| CDN | 1 | €6,000 | N/A |
| Other (monitoring, logs, etc.) | — | €50,000 | N/A |
The pattern was clear: everything was over-provisioned and under-utilized. Eight App Service instances running at 12% CPU. Four SQL databases at 8% utilization. Two Redis caches at 3%. They were paying for capacity they weren't using.
What we changed (weeks 2-6)
Right-sizing (week 2)
We right-sized every resource based on actual utilization data from the previous 90 days:
| Resource | Before | After | Monthly Savings |
|---|---|---|---|
| App Service | 8x P3v2 | 4x P1v2 | €22,000 |
| SQL Database | 4x S4 | 2x S2 + 2x B | €32,000 |
| Redis Cache | 2x P2 | 1x P1 | €7,000 |
| Virtual Machines | 6x D4v2 | 3x D2v2 | €15,000 |
Total savings from right-sizing alone: €76,000/month. And because the resources were running at 12% utilization, the right-sized versions still had plenty of headroom.
Consumption-based plans (week 3)
The biggest single change was moving their API from App Service to Azure Functions (consumption plan). Their API traffic was bursty — high during business hours, near-zero at night — but they were paying for 8 instances running 24/7.
With the consumption plan, they pay per execution. During business hours, the cost is comparable to App Service. At night and on weekends, the cost drops to near zero.
| Metric | App Service (8x P3v2) | Functions (Consumption) |
|---|---|---|
| Monthly cost | €32,000 | €8,500 |
| Cold start latency | None | ~200ms (acceptable) |
| Auto-scaling | Manual | Automatic |
The cold start latency was a concern, but their API was mostly used during business hours, and 200ms was within their acceptable range. For the few endpoints that needed to be always-warm, we kept a small App Service instance.
Database optimization (week 4)
The 4.2-second API endpoint was slow because of the database, not the application. The query that loaded order history was doing an N+1: one query to get the orders, then one query per order to get the line items.
We fixed it with a single query using a JOIN, added a covering index on the columns being filtered and sorted, and implemented read-through caching in Redis for orders older than 24 hours.
| Change | Impact |
|---|---|
| Fix N+1 query | 4.2s → 1.8s |
| Add covering index | 1.8s → 800ms |
| Cache orders > 24h old | 800ms → 380ms |
| Total | 4.2s → 380ms (10x) |
The cache had a 94% hit rate because most order history views are for older orders. The database load dropped so much that we were able to downsize it again.
Storage and CDN (week 5)
Their storage costs were high because they were storing 4TB of user-uploaded files in hot storage. Most of these files were rarely accessed. We moved files older than 30 days to cool storage and files older than 180 days to archive storage.
| Tier | Before | After | Monthly Savings |
|---|---|---|---|
| Hot | 4TB | 1.2TB | €5,200 |
| Cool | 0 | 1.5TB | +€300 |
| Archive | 0 | 1.3TB | +€100 |
| Net savings | €4,800 |
We also optimized their CDN configuration. They were caching everything for 7 days, including dynamic API responses. We split the cache rules: static assets for 30 days, API responses for 5 minutes. This reduced origin requests by 40% and improved response time for cached content.
Monitoring cleanup (week 6)
The "other" category in the audit — €50,000/month — was mostly Azure Monitor and Log Analytics. They were logging everything at the diagnostic level and retaining it for 90 days. We adjusted:
- Reduced diagnostic logging to warning and above for non-critical services
- Reduced retention to 30 days for most logs, 90 days for audit logs
- Sampled performance counters at 60-second intervals instead of 10-second
Savings: €18,000/month.
The result
| Metric | Before | After |
|---|---|---|
| Monthly Azure cost | €180,000 | €72,000 |
| Cost reduction | — | 60% |
| Slowest API response | 4.2 seconds | 380 milliseconds |
| Performance improvement | — | 10x |
| Downtime during optimization | — | 0 |
| Database CPU utilization | 8% (over-provisioned) | 45% (right-sized) |
What we learned
The client wasn't doing anything wrong — they were doing what most teams do. They provisioned for peak load, scaled up when things were slow, and never scaled down. The bill grew incrementally, each increase justified by a specific need, until it was 3x what it should have been.
The performance problem was the same pattern. The API was slow, so they scaled up the database. That made it slightly faster, so they stopped investigating. The actual problem — an N+1 query — was never found because scaling up was easier than profiling.
The lesson: cloud cost and performance are related. Over-provisioning hides performance problems. When you right-size, the problems become visible, and fixing them makes both the cost and the performance better.
If your cloud bill is growing faster than your usage, and your performance isn't improving, you probably have the same problem. The fix isn't more hardware. It's better engineering.