Addressing the subject with traditional direct approaches of cost-cutting such as negotiating for discounts or moving to a cheaper service provider can help you to some extent. Still, your saving results might not be very impressive if comparing to cloud-native options.
I already wrote a guest blog post on a variety of approaches to optimizing your cloud resources costs to demonstrate that this topic is not limited to only bare cloud service price considerations. In this post, I would like to share a few Azure-specific cases on how you can implement those approaches in practice.
Before proceeding to the cases, I highly recommend familiarizing yourself with Azure Cost Management and its analytic capabilities. Basically, it will be your magnifying glass to determine what specific resources or resource types draw the most money from your account.
Even though cloud services are flexible, and you can spin up or take them down in a matter of minutes, most applications have some stable infrastructure resources. It can be some storage solution to keep the application data, or some compute power to keep the app operational at an acceptable level. Azure Reservations provide you with a quick and easy way to save some money on such persistent resources.
Not all Azure services can be reserved, and those that can have different discount levels. Still, if you run any of them in your environment and are likely to continue to run, it worth considering making reservations for them as the implementation effort is incomparable to potential cost benefits. The provisioned reservations are automatically applied to the existing resources of the corresponding type in your subscriptions so that you don’t even need to spend time to make them work for you.
Consider the following example. A business uses Azure SQL Database service in the form of Azure SQL Managed Instance that provides them with sufficient security and isolation for sensitive PII customer data. The instance hosts a few databases with a substantial number of records serving as a data warehouse for BI applications. Usually, such a scenario implies the pattern for high availability and excessive data processing that inevitably drives the high cost for a server with more CPU (vCores) and failover instances. Let’s illustrate this with numbers.
For example, at the time of writing this, a managed instance with 24 vCores and 8 TB storage billed in the pay-as-you-go ‘mode’ will cost you approximately $6k per month, resulting in $72k annually at a minimum. The same configuration backed up with a 1-year reservation will allow you to save more than $14k per year, and that is even without touching Azure Hybrid Benefit yet (more on it later in this post). Now, multiple those figures by the number of instances you have at your disposal.
Sure, there might be a more cost-effective option for a data warehouse, e.g., building it on a less expensive cloud service. However, it might require a substantial amount of time to perform such migration in enterprise environments with multiple technological and process dependencies. While you are working on that, you can benefit from the reservation all the time your expensive services are in operation.
It might seem irrational for people with no or little experience with cloud solutions, but often to reduce your expenditures on cloud services, you should provision more of them. The underlying idea of this approach is that you can use a cheaper service to offload an expensive one and reduce its usage or scale. As a result of expensive service ‘shrinking’, your total for both services is less than the payment for the costly service when used singly. A great example of such collaboration is augmenting your web services with Content Delivery Network, or CDN for short.
Let’s model the following case. A business runs an e-commerce web solution on Azure to sell products to its customers. As there is a high demand for the product, thousands of customers visit the site daily to search for goods and make purchases causing the Azure Web Apps to serve millions of requests. The business needs to host the solution on the P2v2 Premium Service Plan with a minimum of 10 instances to ensure an adequate response time. The monthly cost of the web infrastructure is about $3k. For the sake of simplicity, I omit design nuances for autoscaling, high availability, and network latency optimization.
For an average web site, CDN can cache and serve around 80% of its traffic as most requested resources are no more than just static content: images, CSS stylesheets, script, etc. For example, in the post describing how I run this blog, I shed some light on how CDN helped me to offload 98% of the traffic from this blog hosting. So, by leveraging Azure CDN caching plus moving some static content, e.g., product images, to a Storage account, if applicable, you are highly likely to reduce the number of app instances to 2 and to downgrade them to a less expensive tier like the P1v2 plan. That will reduce the web app service cost to $300 per month only.
Assuming the website has around one million page views per month and the average page size of 3 MB, the CDN will serve around 3 TB of traffic monthly. As CDN pricing varies depending on the region, let’s keep our example simple and use Azure CDN pricing for North America and Europe regions. Based on those inputs, the CDN will add another $250 to your bill. So, in our example, the combination of Azure App Service plus Azure CDN can cost you roughly five times less than if you used the App Service only. I say ‘can’ as my example is oversimplified and somewhat idealistic, and in real-life scenarios, that reduction ratio will be 3 to 1 or so. Anyway, a 60% decrease in operational cost is not something not worthy of your attention.
The software development process varies from product to product and from organization to organization, but the concept of sandboxes where engineers can safely develop, build, and test their code remains unchanged. Although the number of those development environments, their implementation and management specifics might differ, the separation between production and dev/test/stage infrastructure is usually clear. Also, from the operational perspective, the requirements for the availability and performance of the infrastructure that don’t serve real users are generally less demanding. So, how can we decrease our expenditures on dev environments in Azure except obviously using less performance and cheaper service tiers?
Using the top-to-bottom approach, the first thing to pay attention to is Azure Dev/Test subscriptions, which are applicable for both enterprise and pay-as-you-gooffers. By placing your dev resources in those subscriptions, you will get lower prices for most common Azure services for the cost of excluding them from the regular vendor SLA commitments. Plus, all the services that are technically eligible for Azure Hybrid Benefit will have their discount automatically applied for all corresponding service instances in the Dev/Test subscription. Considering the example with Azure SQL Managed Instance from the previous part, Azure Hybrid Benefit enabled will save you more than $20k annually. Not bad, right?
Okay, but what to do if, for some reason, you need your development VMs or databases to be covered with Azure services SLA? Sure, nothing prevents you from provisioning the respective resources in a regular(production) subscription and enabling Azure Hybrid Benefit for them provided that you have enough spare licenses with Software Assurance.
The third one underused option for development environments is Azure DevTest Labs service. Sure, the serverless computing and containers are currently on the verge, but usually, it is some kind of old-school VM-based cloud service that adds to your monthly Azure invoice the most. So, if your development or test processes rely on regular servers, it might be an excellent opportunity to look into Azure DevTest Labs as they can greatly help you with VM provisioning and automating the start/stop processes for them. For example, if your development team works in distinct time zones, you can schedule the VMs to start and stop according to defined business hours automatically. Alternatively, you can automate turning off the VMs that report no user activity for some time. As Azure VMs are billed on an hourly basis, you pay only for the storage, which is a way cheaper than CPU and memory resources, each hour your VM is not running. For instance, you can use the Azure Pricing calculator to estimate how much you can save per month on a VM that is turned on during your regular business hours only. In combination with reduced pricing of Azure Dev/Test subscriptions, Azure DevTest Labs might help you to squeeze far more money than you would need for a Friday beer 😊
The variety of available cloud services and even a more significant number of their possible combinations produce hundreds and thousands of possible options for cost drivers. For example, in one case adding additional services will just result in an increased monthly bill; in another one, introducing a complimentary service such as CDN to your web application can decrease the overall operational cost for the environment tenfold. Redesigning an existing application or architecting a new one with its operational costs in mind is also a great solution, but that shall be a topic for another post. Stay tuned and subscribe so that you don’t miss it! 👇