Trendveris
Live Coverage
Sign in Sign up
Trending: Champions League Transfer News Premier League World Cup
Trendveris
AI & ML

Managing Cold Starts for AI Applications on Cloud Run

A developer on Reddit raised concerns about dealing with cold starts on Cloud Run for AI, citing delays of up to 20 seconds. This highlights the need for effective strategies to optimize performance across multiple regions.

May 27, 2026 | 3 min read
Sign in to save
The challenges around managing cold starts in serverless architectures have become increasingly pronounced, particularly when deploying AI models on platforms like Google Cloud’s Cloud Run. A developer recently took to Reddit in search of assistance, lamenting the frustrating latencies that can stretch up to 20 seconds while waiting for the infrastructure to become responsive. This scenario paints a stark picture of user experience; while waiting for a model to spin up, users are left in the lurch, causing potential losses in engagement and productivity. The conversation that ensued revealed a community grappling with these issues, many opting for the more traditional Google Kubernetes Engine (GKE) simply to sidestep the persistent latency associated with serverless GPU offerings. It's a telling sign that something in the current infrastructure isn't meeting developer needs. Motivated by this feedback, I took a closer look at the mechanics behind AI cold starts, aiming to uncover actionable strategies that could help streamline this process for developers. A recent highlight in this realm occurred during a session I co-presented at Google Cloud Next '26, where I teamed up with Oded Shahar, Senior Engineering Manager for Cloud Run, and Ajay Nair, Global VP of Platform at Elastic. Our presentation, titled "Build AI architectures with custom models on Cloud Run," focused on pragmatic strategies to overcome these cold start challenges. Ajay's insights on Elastic's ability to handle millions of requests daily across a diverse set of model variants without sacrificing the efficiency of Cloud Run's 'scale-to-zero' feature were particularly enlightening. What stood out was Ajay's perspective: the key to fast performance lies not solely within the models themselves but in treating GPUs as versatile compute resources rather than fixed infrastructure. This shift in thinking allows developers to optimize for speed, scalability, and security—crucial elements in maintaining a competitive edge in AI service delivery. As someone deeply entrenched in this field, I recognize that cold start latencies are not an insurmountable obstacle but rather a challenge that can be addressed through strategic architectural decisions. The data collected around these issues may not paint a complete picture, but it’s clear that a more efficient approach is needed to unlock the full potential of serverless AI architectures. In revealing the anatomy of an AI cold start, it's essential to grasp that these delays originate from several phases of infrastructure provisioning, each with its own constraints and bottlenecks. Engaging with this understanding will be pivotal for anyone serious about optimizing their AI deployments.

Strategizing for Scaling and Reliability

As we approach the challenges of scaling AI solutions on platforms like Cloud Run, understanding the nuances of deployment is critical. The right strategies can significantly impact performance and user experience, particularly when it comes to managing cold starts.

Weighing the Always-On Model

Here's the deal: maintaining active instances in multiple regions can quickly escalate costs. Instead of spreading resources thin, a more feasible approach is to adopt an 'always-on' configuration in a single region. This setup allows you to dodge excessively long local cold starts, which can take up to 20 seconds, in favor of a much more user-friendly 100ms global delay. Prioritizing user experience means making smart choices about resource allocation.

The Grace Period Can Work to Your Advantage

One aspect that deserves attention is the 15-minute grace period offered by Cloud Run. This feature keeps instances warm after they handle a request and remain idle. If your traffic pattern is predictable, with user requests arriving within that 10-12 minute window, you may find that an always-on service isn’t even necessary. By leaning into Cloud Run's default settings, you can optimize performance without incurring unnecessary costs.

Anticipating Cold Starts

Sometimes, the best offense is a strong defense. You can forecast potential cold starts using strategic user interface (UI) interactions. For instance, if you know a user will trigger a request, you can dispatch a lightweight health check ahead of time. By the moment they start typing, the resource provisioning will already be in progress, effectively minimizing the latency they experience. A pro tip? Use non-inference endpoints for these health checks. Instead of sending a dummy prompt like "hi," which can introduce delay, leverage endpoints that respond instantly without triggering unnecessary processing on your model. This saves time and resources, and prevents clutter in user interactions.

Optimizing Health Checks

One critical point to consider is the VRAM loading times inherent in AI models. If health checks fail too often, it could prematurely shovel your container into oblivion. To safeguard against this, tweak your health check parameters: 1. **Increase the Failure Threshold**: Set a high threshold—for instance, over 60—paired with an appropriate timing strategy to allow ample startup time. 2. **Leverage Extended Boot Times**: Cloud Run permits up to 30 minutes for startup during intensive workloads, vastly exceeding the typical limits imposed on standard services. 3. **Avoiding False Alarms**: Be cautious with engines like Ollama that might appear to be ready while they delay VRAM loading. Properly preload models in your entrypoint scripts to ensure that health checks only pass when the model is genuinely ready for action.

Lessons from Elastic’s Approach

In a recent session at Google Cloud Next '26, Elastic's Ajay Nair shared insights on how they embrace GPUs as flexible resources—rather than cumbersome infrastructure burdens. Here are three strategies they’ve implemented: 1. **Skip Compilation Costs**: They set `enforce_eager=True` in vLLM, favoring quicker cold start times over slight throughput losses. 2. **Implement Standalone Checkpoints**: This strategy reduces latency incurred from runtime switching by preparing each LoRA variant in advance. 3. **Isolate Workloads**: Each workload—based on model type, task adapter, and traffic—is managed as a distinct Cloud Run service, leading to numerous independently scalable services tied to various model families.

Conclusion and Next Steps

Dialing in the cold start process is what separates casual projects from professional-grade applications. Indeed, Cloud Run simplifies the technicalities, taking care of NVIDIA driver setups and booting instances in roughly five seconds. For those looking to deepen their understanding, links to credible resources are invaluable: - [Best practices for AI inference on Cloud Run with GPUs](https://docs.cloud.google.com/run/docs/configuring/services/gpu-best-practices) - [Configure GPU for Cloud Run services](https://docs.cloud.google.com/run/docs/configuring/services/gpu) - [Startup CPU boost for Cloud Run](https://docs.cloud.google.com/run/docs/configuring/services/cpu#startup-boost) Dive into the full technical exploration by watching the recording of the [Next '26 session](https://www.youtube.com/watch?v=7L5gQHcinzE), which lays out a solid framework for deploying high-performance open models on serverless infrastructure. Happy building!
Source: Shir Meir Lador · cloud.google.com
Sign in to join the discussion.