When going cloud, a lot can go wrong when it comes to optimizing your deployment to avoid costs going crazy. Below I have compiled a list of best practises you can go by when selecting compute options in Azure. The list is meant to offer guidance on how to go about setting up your environment.
- Location – Put all resources that work together in the same Azure region. This will reduce egress traffic between regions which is billed. If you have your compute and storage in the same location you will not be billed for egress traffic
- Optimal Size – Choose the right size of VM from the beginning. Different workloads have different needs e.g. don’t chose something with high CPU and the workload doesn’t require it. Make sure the VM size will ensure that the VM is at 80% utilization levels.
- Continuously resize machines – the beauty of cloud is its agility. This is one of the best reasons for going cloud. If you already know your VMs are for example overworked during end month, then you only need to resize the VM during that period and you can always downsize afterwards. With pay-as-you-go you only get charged for the few hours of extra compute you need. Take note, Microsoft is constantly resizing VM sizes for different purposes. As the administrator it is important you always monitor that.
- Shutdown VMs – during off peak hours or when no one is using the said VM you can set it to automatically turn off every day at 7pm. This will mean you don’t get charged during the off peak.
- Use Dev/Test labs – if you are in a testing environment its always advisable to run a dev/test lab which allows you to apply policies and auto-shutdown and auto-start features.
- Scale Sets – With virtual machine scale sets, start will lower the number of virtual machines
and scale out when the demand increases.
- Monitor – Monitor virtual machines and find its performance and usage metrics. Based on
it, determine if you want to upscale or out scale the virtual machine. It could also
result in down-sizing and reducing the virtual machines.
- Load Balancing – Use a load balancer with public IP to access multiple virtual machines rather than
assigning a public IP to each virtual machine.