The cloud provides the simplicity of creating amazing resources – you can choose whatever you need and access it in a few minutes. However, because of this simplicity, similarity to micropayments as well as lack of proper governance, we thought, at Objectivity, that people using Azure might overlook the cost management aspect of their actions in the cloud.

As always, the reality is much more interesting. We noticed that during resource creation, people do often look at the price, yet they don’t understand the charging schemes or  don’t know which pricing tier to choose because they are not familiar with the system workload (missing NFRs). As a result, they tend to skip this part of the configuration and choose a default option. In our optimisation journey we noticed the following problems that our clients come across:

  • The customer pays for resources that are not necessary at all.
  • The available resources have higher computing power than they need.
  • The customer pays for 24/7 availability of services, although there is no need for them to be running, e.g. overnights or weekends.
  • Services don’t utilise payment discounts available in Azure.

Cloud cost management is a complex subject and requires experience. However, there are a couple of quick tweaks you can use to optimise the cloud costs.

1. Buy reserved instance resources

A reserved instance is the Holy Grail of cost management in the Azure cloud. It allows you to buy resources for a year or three years in advance. Depending on the time period and the resource type, you can reduce your cloud costs up to 72% (from my experience, on average you can get about 30-50% discount for three years’ time). There are two available payment methods:

  • Upfront – you pay immediately for resource usage within a selected period of time.
  • Monthly payments – it’s a new feature that was added in November 2019. In some cases, paying upfront is not an option. For example, you have a limited yearly IT budget and you cannot pay for the cloud upfront, but you still know that a project will live for many years. If you are in such a situation, the monthly payment option is for you because you get a discount and you pay in tranches. The only downside is that every month you have a different market exchange rate for your currency.

    graph illustrating Azure Reserved Instances and pay as you go costs
    Azure Reserved Instances vs Pay as you go

This optimisation should be considered by default for a production (and pre-prod) environment(s). Additionally, if you have your own development team which uses Azure resources for development/testing purposes, and you know that your project will take more than a year, then this is also a good option to manage your costs.

A reserved instance is an option available for such a wide list of Azure resources that it allows to get discounts for almost every customer. The list includes:

  • Virtual machines
  • Virtual machine scale sets
  • Containers services
  • Azure Kubernetes Services (AKS)
  • Service Fabric
  • Azure SQL database
  • Azure Cosmos DB

You can find more information here:

2. Pay for what you really need

There are two more common practices that stifle Azure cost management efforts. Customers often buy Azure services of a higher tier than they really need, or they don’t change the initial infrastructure configuration that became incorrect after some time of running a production system. There are services provided by Azure which may help: Azure Advisor and Azure Cost Management. And those tools are complementary.

Azure Advisor

Azure Advisor is a free service that can recommend improvements in four areas: high availability, security, performance and cost. The cost area provides recommendations based on the usage of Azure resources and should be checked every once in a while (e.g. resizing a virtual machine, shutting down under-utilised instances). Recommendations can be filtered by subscription and resources type, which allows to easily manage them in complex environments. You can find a list of all the available recommendations on MSDN.

Azure Advisor recommendations screen
Figure 1- Azure Advisor recommendations

Azure Cost Management

This free tool allows you to gain insights into your expenses. It provides detailed information and allows you to see what you are really paying for. Additionally, it allows you to look at the estimated costs for the current month and investigate any anomalies.

Azure Cost Management also provides an interesting feature called budgets. It allows you to track the progress of your budget over time and trigger actions if thresholds are reached.

Azure Cost Management - Accumulated and forecasted costs graph
Figure 2 – Azure Cost Management – Accumulated and forecasted costs

 

Azure Cost Management - Daily costs breakdown graph
Figure 3 – Azure Cost Management – Daily costs breakdown

3. Don’t pay for resources off-hours

We have noticed that customers frequently have a lot of resources that are critical and yet they don’t need to be used during weekends or off-hours. If you decide to de-allocate such resources during weekends, you can reduce your costs by approximately 28% per month. Just imagine having hundreds of VMs or other resources!

4. Choose the correct operating system

Many of the Azure services require you to choose a Windows or Linux operating system. If your solution can work with both, then you should consider using Linux. For instance, Azure App Service Plan from V2 Premium tier with Windows system costs 108 GBP, while exactly the same hardware specification with Linux costs around 63 GBP. That’s a 41% saving!

graph of Azure services OS price comparison
Azure services OS price comparison

5. Use Azure Hybrid benefit

Over the years, many companies have invested in on-premise Windows Server and SQL Server licenses. If they have not utilized them, it is possible to use those licenses on Azure, thus lowering a fee for e.g. Azure Virtual Machine, Azure SQL Database and SQL Server on a virtual machine. More information can be found here.

6. Verify your purchasing channel

If you are a web direct customer, which means that you pay “general public” prices for Azure resources, then you should consider signing an Enterprise Agreement with Microsoft.

Another option, valid especially when building a new system, is to find a Cloud Solution Provider (CSP) partner. CSP companies are Microsoft partners that help to build Azure solutions. For example, Objectivity is a CSP indirect reseller, which means we have better prices and can negotiate them further.

7. Takeaways

Azure cost management and optimisation is a task that requires a lot of effort and knowledge. In order to do it well, an audit of the existing infrastructure is necessary. However, the key to effective cost optimisation is to get value within a short period of time. Otherwise, you might overinvest in an investigation that could yield findings not worth the time and effort. Therefore, your best bet is to start with quick tweaks described here.

The main point is that you can optimise your cloud costs in many ways. You can do it by:

  • Tweaking the configuration of your existing service (use the tweaks listed in this article),
  • Replacing one service with another (without changing the code),
  • Changing the source code so that your solution can leverage native cloud architecture.

The more your changes go outside the scope of the tweaks that you can perform in the cloud, the more expensive they’ll be. However, in some cases even rewriting a source code is an option worth considering. At Objectivity, we’ve solved many cloud-related challenges, so if you’re looking for Azure cost management advice or need some other type of cloud consultancy, we will be glad to help. Feel free to contact us here.