- Amir Boroumand | Software engineer based in Pittsburgh, PA/
- blog/
- ✂️ The Playbook for Cutting Cloud Costs/
✂️ The Playbook for Cutting Cloud Costs
Shutdown non-production resources outside of business hours #
You don’t leave all the lights on when you leave the house. So why do that in the cloud?
Business hours only constitute about 23% of the total hours in a month.
Build automation to stop non-critical resources each week night and start them back up weekday mornings.
Automate cleanup of unused resources #
Build scripts or tools to automatically detect and clean up orphaned volumes, unattached IPs, and old snapshots that are no longer needed.
Right-size resources #
Many organizations tend to overprovision resources when they move to the cloud.
Right-sizing means adjusting these resources so they are appropriate size and capability for your current requirements.
Review the historical utilization metrics for resources to determine if they have been overprovisioned.
Leverage spot instances #
Spot instances are spare compute capacity offered at a deep discount to list price (up to 90%).
They are subject to automatic termination when the demand from on-demand customers rises. To manage this, users are provided with a predefined warning period before termination occurs.
So you need to ensure your workloads can accommodate interruptions or can finish within the termination window.
Purchase reserved instances #
Reserved instances allow you to commit to using a certain amount of resources for a specified period, typically one to three years, in exchange for significantly reduced costs compared to on-demand pricing (typically 30%-60%).
Purchasing these makes sense when you have a clear, long-term need for specific types of compute instances.
Setup lifecycle policies for object storage #
Lifecycle policies automate the process of transitioning objects between different storage classes based on predefined criteria, such as access frequency and age.
Ensure that your lifecycle policies comply with any data retention requirements your organization might have. This includes legal and regulatory compliance, which might dictate how long certain types of data need to be retained.
Setup budget alerts and tag resources #
Budget alerts notify you when your monthly cloud spend approaches or exceeds a predetermined threshold. This “early warning system” can help avoid budget overruns.
Tagging involves assigning metadata to resources such as the owner, purpose, environment (e.g., production, development), or cost center. Tagging allows you to track and allocate costs. This is particularly useful in organizations where costs need to be charged back to different departments or projects.
Review data transfer costs #
The major cloud providers impose charges per GB for network egress, which is the transfer of data out of their cloud networks to the internet or to another cloud provider.
If you are hosting bandwidth intensive applications or have third-party vendors ingesting your data, these fees can become substantial.
Use Function-as-a-Service (FaaS) for short-lived event-driven tasks #
Instead of relying on continuously running servers, FaaS allows you to execute code in response to events without the overhead of managing server infrastructure.
This is best suited for intermittent, short-lived operations like processing file uploads, handling API requests, or executing scheduled tasks.
You’re billed only for the compute time you consume.
Consolidate billing accounts #
If you have multiple accounts, consolidating them under a single billing account can help you qualify for volume discounts and better manage overall spending.