Cost optimization is one of pillars of public clouds (AWS, Azure, GCP) architecture frameworks. There are great resources available which discuss cost optimization in depth. You will find some links at the end of this post.
Motivation
Cloud computing providers promise on demand access to resources. Sometimes, this might lead to over provision of resources. Little monthly costs accumulate over time and can translate into hundreds or thousands of bucks per year. Do not underestimate the peanut costs.
It is not just about money; cost savings are also a matter of principle. Saving costs is very appealing financially. However, it can also be translated to saving energy by stopping or reducing resource consumption.
I am going to share how I am optimizing the costs and saving money in Azure subscriptions I manage. The cost savings can happen before provisioning resources as well as after creating the resources. Different resources have different pricing models. This means we need to be aware of these pricing models and find out how we can save money and resources.
This is going to be a blog post which I will update continuously based on my work experiences and what I learn from others. Please do not hesitate to share your tips with me.
Azure App Service
Apps which are stopped are still being charged according to the App Service Plan tier. To eliminate these charges, delete any apps that are not in use or update the tier to the Free option.
However, be aware that the Free tier does not support regional VNET integration or the AlwaysOn feature. To update the tier to Free, you must remove the VNET binding and disable the AlwaysOn feature (App Service → Settings → Configurations → General settings)
Virtual Machine Disks
It is a good practice to provision disk space based on current needs. It is possible to increase the capacity and change the tiers later. Virtual machine (VM) disk storage are charged all the time, even when the VM is stopped. The cost of the disk storage is based on the provisioned capacity, not the used space. Please note that downsizing of disk storage is not supported in Azure.
Therefore, it is better to start with minimum storage capacity and tier and increase when the need arises. Try to avoid creating Premium SSD and Ultra Disk tiers. For most projects, Standard HDD or Standard SSD are sufficient.
Conclusions
Cost optimization in the cloud requires continuous monitoring and management. By being proactive and making adjustments as needed, you can ensure that you are getting the most value out of your cloud resources.
Resources
- Azure Cost Calculator
- App Service Pricing
- Managed Disks Pricing
- Google Cloud Architecture Framework: Cost optimization pillar
- AWS cost optimization pillar
- Azure cost optimization documentation