Google Cloud recently introduced the second generation startup CPU boost for Cloud Run and Cloud Functions. This is a new feature that allows a developer to significantly reduce cold start times for his Cloud Runs and Cloud Functions. New features are currently in preview.
Cloud Run allows developers to run software container applications on Google Cloud’s infrastructure and automate various maintenance tasks. Similarly, Cloud Functions allow developers to host their software and automate tasks on Google Cloud’s infrastructure. Additionally, Cloud Functions recently became generally available (GA) with several improvements.
Both Cloud Run and Cloud Function have been upgraded with a CPU boost at startup to improve the performance of deployed workloads by reducing application startup time. In the past, it was possible for an application to experience a so-called “cold start”. This is the latency incurred while processing the request due to starting a new container instance to process the request. Therefore, Google introduced minimal instances to reduce cold starts. however, Stellen Gianninia group product manager at Google Cloud, explains in a blog post:
Minimal instances can be used to remove the cold start that occurs when going from zero to one instance, but min instances scale out traffic to more instances, so all cold start solutions are There is none. As part of our ongoing effort to give you more control over cold start latency, Startup CPU Boost helps speed up every cold start.
Furthermore, Giannini also replied: Tweet About launch CPU boost and idle instance cost:
They are complementary: – Min instance is here mainly for ‘0->1’ cases to eliminate cold starts completely – Startup CPU Boost is here for N->N+1 Yes, it speeds up cold starts, but doesn’t eliminate them. Use both, as CPU boosts don’t affect your bill much.
Startup CPU boosting dynamically allocates more CPU to containers at startup so they can start serving requests faster. The company claims that startup times have been cut in half for some workloads measured with this feature. For example, for Java applications, Google’s internal testers and private his preview customers report:
Developers can now enable startup CPU boosting for existing Cloud Run services with a single command (or clicking a checkbox in the console). At the same time, Cloud Functions uses this functionality by default.
Finally, be aware that other public cloud vendors, AWS and Microsoft, also offer FaaS and treat cold starts differently. For example, AWS Lambda allows developers to take advantage of provisioned concurrency, while Azure Functions allows them to choose to run their functions in a separate App Service plan.