My Azure .NET App Was Burning Money — Until I Optimized CPU by 4x and Memory by 10x!

Background We have a mission-critical application used across multiple locations. It is a legacy .NET MVC application that leverages Redis for caching and SQL Server for data storage. The application is hosted on Azure App Service Premium V2, running on the highest P3 plan, which costs approximately $580 per instance. During peak hours, it operates on three instances, while during off-peak hours, it scales down to two instances. The application was initially developed by experienced developers, ensuring a solid foundation. However, over time, its maintenance was handed over to junior L4 developers and the L3 support team. With each new enhancement, performance gradually deteriorated, leading to inefficiencies and skyrocketing resource consumption — ultimately transforming it into a resource-hungry monster.

Mar 7, 2025 - 05:32
 0
My Azure .NET App Was Burning Money — Until I Optimized CPU by 4x and Memory by 10x!

Background

We have a mission-critical application used across multiple locations. It is a legacy .NET MVC application that leverages Redis for caching and SQL Server for data storage. The application is hosted on Azure App Service Premium V2, running on the highest P3 plan, which costs approximately $580 per instance. During peak hours, it operates on three instances, while during off-peak hours, it scales down to two instances.

The application was initially developed by experienced developers, ensuring a solid foundation. However, over time, its maintenance was handed over to junior L4 developers and the L3 support team. With each new enhancement, performance gradually deteriorated, leading to inefficiencies and skyrocketing resource consumption — ultimately transforming it into a resource-hungry monster.