Does your apps consume Google Services ? Switch to GCP for cost savings and better performance !!

Gauravmadan
Google Cloud - Community
7 min readAug 17, 2022

Authors : Gaurav Madan and Nakul Gandha

Context

When it comes to public cloud adoption , some factors that play a decisive role are service availability in your region of choice ,user experience ,cost ,ease of operations etc.

From a technical architect / designers point of view ; we tend to focus a lot on design excellence and aim to achieve the desired functionality by arranging the cloud construct in the best possible manner so that we can deliver high value to our end customer . While doing this state of art design , architects tend to to put less emphasis on cost control / cost optimization parameters because design excellence takes higher place in priority list for most of architects. The purpose of this blog is to showcase how architects dealing with complex application design & utilizing certain well known Google services can simply ignore their network cost focus on GCP platform , and automatically enjoy reduced spend on network egress in their monthly cloud spend.

A quick brief about network Pricing in GCP

Before we dive into customer specific scenarios , let’s understand high level nuances of Network egress spend that any customer might end up paying .

At a high level , any traffic leaving a GCP resource can be categorized as follows -

  1. Internal Traffic : Also known as backbone traffic . This is traffic that will remain within our backbone. Examples include — VM1 in GCP region1 talking to VM2 in GCP region2
  2. External Traffic : This is traffic that leaves Google’s network and is generally destined for end users (commonly internet).

If we have to map the type of traffic with egress pricing SKUs in GCP , spend done against egress in GCP will fall in one of following 4 broad categories -

  1. VM to VM egress pricing within Google Cloud
  2. VM to Google services pricing
  3. Internet Egress pricing — premium tier
  4. Internet Egress pricing — standard tier

The charges for category (B) above is priced based on the following -

  • Source and destination VMs in the same zone of a given region ?
  • Source and destination VMs in different zones of a given region ?
  • Source and destination VMs in different regions , but still the same continent ?
  • Source and destination VMs in different continents ?

The charges against Internet egress for Standard Tier [ category C] is based on following -

  • Source geolocation of traffic (which GCP region)
  • Monthly usage

The charges against Internet egress for Premium Tier [ category D ] is based on following -

  • Source and destination geolocation of traffic
  • Monthly usage

The focus of this blog is on CATEGORY A (VM to Google service ) and I will like to call out a few important points here :

  1. If a Google cloud resource like a VM calls Google service like a Youtube , drive , maps ; there is no egress charge for this transaction
  2. If a Google cloud resource like a VM calls Google Cloud service outside of its region , there is a charge , which is same as VM to VM egress charge within Google cloud
  3. Egress to some Google Cloud service within the same region using an external IP address / internal IP address also attracts zero Network egress charge
  4. There are some services like Memorystore for Redis, Filestore, Cloud SQL, and Google Kubernetes Engine ; which attract an egress cost even when accessed from within same region also . The cost will be same as VM to VM egress cost within Google cloud

A simple view of this can be seen below -

More detailed pricing is available at weblink : https://cloud.google.com/vpc/network-pricing . I highly encourage the readers to spend some time going through the said URL to understand the nuances. In addition to this , I also highly encourage readers to also read about the network specific charges that may be applicable in case you are using a stand-alone service like a Google cloud storage bucket . For example : In addition to storage cost , data processing cost , there will be a Network cost associated if there is data read from or moved between your GCS storage buckets.

Optimize your data egress cost — Migrate to Google Cloud

Whether you are in the business of uploading mass videos to youtube, calling Google Maps APIs or sending notifications through Firebase, Google Cloud has got you covered from the perspective of cost of network egress. Infact , as per GCP’s public documentation at https://cloud.google.com/vpc/network-pricing#all-networking-pricing ,

Egress to specific Google non-cloud products such as YouTube, Maps, DoubleClick, and Drive, whether from a VM in Google Cloud with an external IP address or an internal IP address comes at No Charge.

As per same URL ; Egress to Google Cloud Service (e.g. Firebase) is also at no charge if you are in the same region as your source.

As a real-life example, we would illustrate a use-case where the customer could save 99% of their egress charges (running into hundreds of thousand dollars per annum) by moving their application from their current cloud provider to GCP.

Customer Scenario

The customer is a pure born-in-cloud with no presence of infrastructure at on-premise. At a 1000-feet level ; their infrastructure in public cloud (non-GCP) consisted of hundreds of ‘Pusher Servers’ which send notifications to end-clients , 99% of these clients constitute of Chrome browser or Android phones.

Since using Google’s Firebase notifications service comes at no charge, they are leveraging firebase cloud messaging (FCM) service.
An approximate 250 billion request was hitting from his cloud hosted infrastructure to Firebase services in a month .

Since the requests originated in an alternate cloud provider( non-GCP) , each call to fcm.googleapis.com (with an average of 4KB payload ) amounted to more than 30 TB data egress to the internet. Hence the customer was paying above ~25K USD on network egress with an alternate cloud provider (non-GCP) .

Customer’s transformed setup

After engaging with the customer , we could see the big spend on network egress and this was one area which we wanted to solve .FCM is a global service and hence based on the workload calling FCM service , we can save a lot of network egress cost. As mentioned above , the network egress cost while the traffic is on Google backbone depends on source as well as destination location . While FCM is a global service , the cost will depend on which cell of FCM service was a given request served from .

To prove this , we had to first plan positioning of workloads which will call the fcm service . Being an APAC heavy customer ,we did tests with their workloads calling FCM service hosted in asia-southeast1 region of GCP (Singapore) . With this setup , we tested 7 billion hits per day to FCM service for one month duration . From the GCP point of view , this got charged at the same price as VM-to-VM pricing (intra-region within Singapore) Or sometimes (as intra-zone within Singapore region). This goes back to our section on GCP Network pricing at the start of this document .. The service “fcm” is a Google cloud service ; the host machines calling this service are also on the Google cloud network backbone . So more or less traffic is internal to Google cloud. Hence it was important for us to find out appropriate positioning of workloads so that Network charges applicable can be minimized ( traffic stays within region Or even better if it stays in a zone of given region ) . After a month of testing , we were able to showcase an egress price drop of 99% in GCP w.r.t their current monthly spend on egress with an alternate public cloud provider . Which means that moving entire application on GCP will almost eliminate the spend that customer is doing currently on ‘network egress’ with a alternate public cloud provider. This POC helped customer to take a informed decision of moving his application on GCP

Conclusion

One of the pushing factors behind adoption of public cloud is Cost and hence when it comes to spend on public cloud “each penny matters” . Hence understanding and answering the questions like which service workload will consume , which other workload will my workload talk to , where are my end users who access my workload will help us better plan the geographical positioning of workloads .

For applications utilizing Google services like maps , drive , youtube ; it is a no brainer to host such application on GCP platform because network egress cost for application hosted on GCP to access these Google services is zero and this is where customers will save a lot of money

Also for applications utilizing Google Cloud services ; it is a easy thing to conclude that if such application are hosted on GCP ; customer’s network egress cost for his application to access these Google cloud services will either be free Or will be charged as per VM to VM pricing SKU , which is much cheaper than an alternate cloud provider’s egress cost because traffic will leave the alternate cloud provider’s infrastructure. This again can end up helping customers to save a lot of money.

Useful References:

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

Understanding GCP Network Pricing : https://cloud.google.com/vpc/pricing

Disclaimer: This is to inform readers that the views, thoughts, and opinions expressed in the text belong solely to the author, and not necessarily to the author’s employer, organization, committee or other group or individual.

--

--