Skip to main content


Showing posts from November, 2019

Scheduling Google Compute Instances with Cloud Scheduler

Our company needs to save some cost for the running staging instances. Since the instance and any related resources are used only when we are at work, we need the instance to be available only at working hours, or from Monday to Friday, 9 to 5. It approximately reduces our cost to roughly 45%. A huge diff.

The Ingredients We need the following components from Google Cloud:
Google Cloud Scheduler: to run a function at an exact day/time.Google Cloud Functions: to start and stop our compute instances.Google Cloud Pub/Sub: as a bridge or messenger from the Cloud Scheduler to the  Cloud Functions.Lastly, the Google Cloud Compute Engine Instances. Each of those will cost us money, but the good news is we will work under the fair usage policy so it can be said that all of those will be free of charge. For example, now Google Cloud gives us 93x each month for Cloud Functions. That means if we only use it twice a day (to start and stop the instance), it will cost us nothing.

We also can use the…