GCP Checklist 8 — Cost Optimisation

Grace
Google Cloud - Community
2 min readDec 17, 2018

As part of configuring your GCP organisation and application environment within your organisation you need to consider costs . What happens if you don’t put reasonable limits on auto scaling services? Are you running under utilised resources? Do you have a budget and what actions will you take if that budget is reached?

GCP has a number of features to help you with managing costs which you should understand and take advantage of.

  • When you have designed your application and have some idea of resources needed you can plug the data into the pricing calculator
  • Sustained Use Discounts for Google Compute Engine automatically lower the price of your virtual machines (VMs) when you use them to run sustained workloads. You do not need to undertake any proactive actions for the discounts to take effect.
  • Committed Use Discounts for Google Compute Engine offers the ability to purchase committed use contracts in return for deeply discounted prices for VM usage. If your workload is stable and predictable, you can purchase a specific amount of vCPUs and memory for a discount off of normal prices in return for committing to a usage term of 1 year or 3 years.
  • Setting a budget alert at a specific amount or match it to the previous month’s gives an alert when spending exceeds a percentage of your budget. Giving you time to action appropriately.
  • Default quotas help you to keep within a set usage until you explicitly request for the quota to be raised
  • If you have no leeway in your budget and are comfortable with your application not working once a cap is reached then you can depending on the API, explicitly cap requests in a variety of ways, including: requests per day, requests per 100 seconds, and requests per 100 seconds per user.
  • If your application doesn’t fit the standard instance types you can use custom machine types optimized to match the profile of your application and ultimately pay for the resources your application uses versus paying for excess vCpu and memory that you may end up with when using a standard instance
  • GCP provides machine type recommendations to help you optimise the resource utilisation of your virtual machine instances. These recommendations are generated automatically based on system metrics gathered by the Google Stackdriver Monitoring service over the previous 8 days
  • GCP provides billing reports and you can also create a billing dashboard that allows you to understand your costs and analyse cost trends .

When you are ready to get started ensure you read the billing on-boarding checklist as your first step

This reading list was slightly longer than I anticipated but they’re all worth pursuing:

https://cloud.google.com/billing/docs/onboarding-checklist

https://cloud.google.com/pricing/innovation

https://cloud.google.com/products/calculator/

https://cloud.google.com/billing/docs/how-to/billing-access

https://cloud.google.com/iam/docs/job-functions/billing

https://cloud.google.com/billing/docs/how-to/reports

https://cloud.google.com/compute/quotas#checking_your_quota

Labelling & grouping your GCP resources

https://cloud.google.com/billing/docs/how-to/visualize-data

https://cloud.google.com/compute/docs/instances/apply-sizing-recommendations-for-instances

https://cloud.google.com/compute/docs/sustained-use-discounts

https://cloud.google.com/compute/docs/instances/signing-up-committed-use-discounts

https://cloud.google.com/custom-machine-types/

https://cloud.google.com/apis/docs/capping-api-usage

https://cloud.google.com/billing/docs/how-to/budgets

Here’s the Check list:

A list of all the checklists in the series can be found here

--

--

Grace
Google Cloud - Community

Chocolate addict - I have it under control really I do. I do stuff involving cloudy tech. Tweets my own so only me to blame, except for retweets.