DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Simplify Your Compliance With Google Cloud Assured Workloads
  • How To Build Translate Solutions With Google Cloud Translate AI
  • Building and Deploying a Chatbot With Google Cloud Run and Dialogflow
  • Provision Cloud Infrastructure Using Google Duet AI

Trending

  • Using Java Stream Gatherers To Improve Stateful Operations
  • Advancing Your Software Engineering Career in 2025
  • Efficient API Communication With Spring WebClient
  • Code Reviews: Building an AI-Powered GitHub Integration
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. GCP Cost Management Best Practices

GCP Cost Management Best Practices

Because Google makes enough money already.

By 
Kevin Johnson user avatar
Kevin Johnson
·
Apr. 10, 21 · Opinion
Likes (2)
Comment
Save
Tweet
Share
8.1K Views

Join the DZone community and get the full member experience.

Join For Free

One of the advantages of building your infrastructure through cloud providers is that you can scale up and down as per your business’ resource demands and pay only for the services that you leverage. However, if you don’t keep an eye on which services are running and monitor your billing and performance regularly, you may end up incurring unnecessary and inefficient business costs.

At GCP, the platform’s solution architects work very closely with their customers to support Google Cloud cost optimization and control the expenses. There are several tools and tricks that are simple to exploit to save unnecessary costs on GCP. It’s simply a matter of knowing what and where to track. In this article, we will discuss Google Cloud cost management and uncover how you can optimize performance and resources to get the best usage output.

How Does GCP Billing Work?

A critical step in this process involves setting up a billing account in GCP at a project level. When you are creating a GCP project, you have to link a billing account to that project. Optimize this billing account to configure all your billing information, including payment options. You also can link one billing account to multiple GCP projects to improve visibility and billing transparency at a bird’s eye view for your team, department, or organization. 

GCP will continue to allow you to use only free services if you do not link your project to a billing account. Once you make the connection, the platform charges your Google Cloud account every month automatically and sends you the invoice according to your usage. It’s useful to note that you can create billing sub-accounts if you would like to have separate invoices per project. There are some GCP service resellers who use sub-accounts for their clients to generate separate bills for them.

How Much Does GCP Cost?

The pricing of Google Cloud Platform ranges across its 15+ product categories, including cloud compute, database, networking, AI and machine learning, containers, and more. Each product category provides a multitude of Google Cloud products/services all designed for a variety of purposes. We’ll hold off on discussing all the price lists of different products that GCP offers, as that would require more than a couple of blog pages. However, you can dive in at leisure here. For best practice Google Cloud cost management though, we do suggest you always use the price calculator by GCP to estimate and forecast your monthly bills based on services required to keep on top of your costs.

Note, you do not have to pay for all the available services in GCP, there are few free offerings to exploit. Google Cloud Platform offers 20+ free products to provide you free hands-on experience. GCP also provides $300 for a user who signs up on Google Cloud for the first time. GCP will not charge you until you cross the $300 threshold in your total billing. With this free credit, you can use the paid services and products offered by Google Cloud without any limitations. Check out all the free services available in GCP here.

How Can I Reduce My GCP Cost?

There are several tools that GCP provides which you can use when optimizing your GCP costs and getting your cloud accounts under control. These tools make sure that accidentally you do not end up over utilizing the GCP services, which might generate a huge bill. These critical tools are budgets and alerts, billing export, reports and quotas. 

GCP Budgeting and Alerting

Budget and alerting in GCP helps you set a budget limit and an alert notification when the budget limit crosses. So, let’s say if you set a budget limit of $10000 and an alert for 80% usage, you will receive a notification from GCP once the usage of worth $8000 crosses in the billing. This way, you will always be aware of your GCP service utilization.

GCP Billing Export Tool

The billing export tool helps you in storing all the billing information of your GCP account. You can use a BigQuery data set or a cloud storage bucket to store the billing data. 

Google Cloud Billing Reports

Reports in GCP is a data visualization tool in the console which monitors all the expenses related to your projects and services. By looking at the reports, you can quickly figure out which services are running and their cost in detail.

Google Cloud Quotas

Quotas in GCP is one very important tool to keep the cost of your GCP account on track. Quotas help you prevent overconsumption of any GCP resource because of some bug or a malicious attack. You can apply quotas on the GCP project level and avoid any unforeseen billing charges in your GCP projects. GCP offers two quotas – allocation quotas and rate quotas. The allocation quota restricts the number of resources you can have in your GCP project. But this quota does not reset itself, you need to delete the resources you are not using in the project. Rate quota limits the number of calls on a specific service, like the number of API calls in a day. This quota resets after a time interval, it can be a minute or an hour, or a day.

What Are GCP Cost Optimization Best Practices?

To keep the billing on your GCP account in control, there are several cost-efficient approaches that you can implement. Below is a curated list of the best practices for GCP cost optimization:

  • Use the GCP pricing calculator once you have clarity on the GCP services you plan to leverage in your project. Using the calculator will allow you and your business to optimize the GCP bill you will incur at the end of the month.
  • If you have a clear idea of your workload, you can save 57% on workload costs by paying for them before the usage. Google Cloud gives you heavy discounts, which you can leverage by making a commitment to pay for X number of resources a month. Such a commitment can be inclusive of the variety of resource types (CUDs for GCE and Cloud SQL as well as BigQuery fixed-rate/slot commitments for example).
  • Check your recent GCP bills over the previous few months and set up budget limits and alerting accordingly. If you exceed the usage, you will get an alert that will help you keep your monthly bill and cloud account in control.
  • Always create a billing dashboard to keep a close eye on the expenses. The dashboard will help you visualize and analyze cost trends and replan accordingly.
  • For non-production workloads, you can set up a kill switch where you can cap your costs in your Google Cloud Platform environment instance. If your account meets a particular threshold in terms of monthly costs, you can use that as the basis trigger for this system. Instead of email, use Google Cloud Pub/Sub, which is just an asynchronous publish-subscribe messaging system. Use Pub/Sub to connect to a cloud function that will be the mechanism by which you can disable billing for the project using the billing API. Be careful with this kill switch to ensure it’s on your non-production workload, disabling billing otherwise could effectively shut down your production environment.
  • Regularly delete resources that are not in use, such as unattached block storage discs, IP addresses not in use, obsolete snapshots, etc.
  • GCP has several options of storage depending on how frequently you use the data. So, you can move all the data which is not used frequently to lower-cost storage. The access and speed to this cold data will be low, but the service saves you some money.

Conclusion

Cost optimization and management are very crucial aspects when you are working with Google Cloud Platform. Maintaining lower costs is a business requirement in every organization, so it’s important to stay on trend around best practice GCP cost management. Thorough management and monitoring of your GCP resource usage can make a critical difference in your monthly bills and to your business's bottom line. 

Cloud Google (verb) Data visualization

Published at DZone with permission of Kevin Johnson. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Simplify Your Compliance With Google Cloud Assured Workloads
  • How To Build Translate Solutions With Google Cloud Translate AI
  • Building and Deploying a Chatbot With Google Cloud Run and Dialogflow
  • Provision Cloud Infrastructure Using Google Duet AI

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!