Billing, Discounts & keeping costs low on GCP.
sustained use discounts:
- Google will provide you sustained discounts in case if the virtual instance is running more than 25% of the month.
- Sustained discounts are automatically applied usually the discount is between 20-50% on every incremental minute.
- The sustained use discounts do not apply for certain machine types like E2 & A2
- The sustained use discounts do not also apply if the Virtual instances are created by App Engine or Data flow.
Committed use discounts:
- You can get up to 70% discount for committed use of 1 to 3 years.
- This is recommended for workloads with predictable needs.
- This is applicable for instances created by App Engine or Kubernetes Engine.
- This does not apply for Virtual instances created by App Engine flexible or Data flow.
- Below is screen shot where you can find the committed discount option.
Spot Virtual Instances:
- These are short lived instances that typically run for less than 24 hours.
- Instances can be stopped by Google anytime with just a 30 second warning.
- The good example when we can use these is if we need a cheap resource & with no need for any SLA and the application in our requirement is extremely fault tolerant.
- Spot instances are also called spot instances and when creating a VM you can find them under availability policy.
Billing :
- For compute engines you are billed by the second after a minimum of 1 minute
- You are not billed for compute when the virtual instance is stopped
- When the compute instance is stopped you are still charged for the storage attached to it and any static IP address that is attached to that virtual instance.
- You should ideally create a budget alert that Email’s billing details to the admin when a certain amount exceeds.
- Navigate to Billing & then click on Budget and alerts where you can create a budget.
- When the target budget is about to exceed the administrator will receive an Email notification.
- You can also do a billing export and run queries on it about which we will discuss later.