Extreme cold starts + slow response times → ADK feels too heavy for real-world chat UX right now
I’m hitting some brutal latency issues with ADK when running api_server locally.
Cold start latency: ~20 seconds Response time after that: still 5–10 seconds per message Even with the simplest possible agent setup.
How to Reproduce
- Installed the latest
adkversion - Created a barebones agent:
from google.adk import LlmAgent
base_root = LlmAgent(
name="base",
model="gemini-2.5-flash",
description="you say hi",
instruction="just chat with the user, say hi and keep up a normal convo",
)
root_agent = base_root
- Started
api_serverwith Supabase (Postgres):
./.venv/bin/adk api_server \
--session_service_uri "postgresql://postgres.glpbqsmkqaiymilerbxe:[REDACTED]@aws-0-us-east-2.pooler.supabase.com:6543/postgres" \
--log_level DEBUG
- Sent the first message via
POSTto/run_sse - Got a 20-second delay for the first response, then 5–10 seconds for every message after.
Expected Behavior
- First response in <3s
- Subsequent responses in <2s
- A simple “hi” shouldn’t take 20+ seconds of backend processing
Debug Logs (simplified)
12:09:53,118 - New session created
12:09:56,564 - Loading agent app - not in cache
12:09:59,961 - Sending out request to Gemini
12:10:00,534 - Starting new HTTPS connection for OAuth
12:10:01,716 - Response received from model ("Hi there!")
12:10:03,032 - Generated event in agent run streaming
That’s ~10s just in backend processing, not counting frontend/network overhead.
Setup
- macOS (Apple Silicon, MacBook Air M2, 8GB RAM)
- Python 3.13
- ADK 1.8.0
- PostgreSQL on Supabase (US East)
- Location: Morocco (150–200ms latency to US East)
- Model:
gemini-2.5-flash(also testedgemini-1.5-flash) - Backend: Vertex AI
Bottlenecks I see in the logs
- Agent loading: takes 3+ seconds (
Loading agent app - not in cache) - OAuth auth: spins up a new HTTPS connection each time
- DB latency: Morocco → US East adds more delay
- Still happens even with the dumbest possible agent config
This basically makes ADK unusable for any production chat app where users expect near real-time replies. The weird part is, Gemini 2.5 Flash is a fast model, So the bottleneck seems to be inside ADK itself, not the model.
Might be related to issue #2433 (Cloud Run cold starts), but here it happens locally with a persistent server.
Bump, Adding as I see no activity here, I have tried multiple versions of the google-adk library and have seen import times between 12-20s on cold starts. Trying to integrate an agentic flow into my django application, due to which the boot time for the app has gone up 4x which makes hotreload sluggish in development, I know I can use a lazy loaded approach, but first time I've had to do so.
Bump, Experiencing same issues. Right now I am avoiding heavy testing on local, lol. On production having ready instances with autoscaling is helpful but it still feels slow compared to popular daily used chat applications out there.
Is this reproduceable in latest release ? I cannot see this issue with 2.5-flash model.
Hi there, any workaround?
Bump. This is becoming an extreme latency problem for us. A raw chatgpt call is about 20x faster than the adk call to the same chatgpt endpoint.
Cold starts take an eternity.
NOTE: Read in reverse order, bottom up, note the start of the POST /run_sse request. to the next log is a 3 minute spin up.
Hi @JokingLemon @rparme @wemakebharat @codeninja , thanks for reporting this issue, would you mind elaborating your issue and environment set up respectively?
Some things we want to understand more:
- The environment: local runner / adk fast_api / adk web / adk deploy cloud run / agent engine
- The session service used: in memory / DB / VertexAiSession
- Agent setup: single agent / multi-agent / workflow / custom agent
- Tools: MCP / A2A
Trying to gather more info so we can debug further, thanks!
Hi @DeanChensj,
Thanks for looking into this! Here are the details for our setup:
Environment:
- The environment: Local development + production on Kubernetes (EKS 1.34)
- Runtime: FastAPI application
fastapi==0.117.1google-adk==1.14.1uvicorn==0.34.0
Session service used:
- Tested with both
InMemorySessionServiceandDatabaseSessionService(MySQL connection URI) - Slow startup persists with both implementations
Agent setup:
- Multi-agent: 1 root agent + 1 sub-agent
- Tools: 4 custom function tools
Models:
- Worker:
gemini-2.5-flash - Critic:
gemini-2.5-pro
Primary Issue:
The main bottleneck we're experiencing is long cold start times when the FastAPI server boots. We've observed that simply importing the google.adk library significantly slows down application startup, even before any agent initialization occurs. This affects both development (frequent restarts) and production (pod scaling, deployments). We haven't yet measured response time latency after the initial startup completes.
The startup delay seems independent of the session service choice, suggesting it's related to ADK import/initialization overhead rather than external dependencies.
Let me know if you need any additional details!
Thanks for the detailed report and everyone who contributed their experiences! This issue is closely related to #2433, which identified the root cause: eager imports in ADK's __init__.py files causing 8-20+ second import overhead.
While this issue focuses on the downstream effects (20s cold starts, slow response times), and #2433 focuses on the Cloud Run cold start problem, they share the same root cause and solution. To consolidate community feedback and avoid splitting the discussion, I'm marking this as a duplicate of #2433.
Key points from this thread that apply to #2433:
- @JokingLemon: 12-20s import times affecting Django hot-reload
- @codeninja: 3-minute cold start observed
- @rparme: Detailed FastAPI/Kubernetes setup showing import overhead as the bottleneck
- Multiple reports of real-world production impact
Please follow #2433 for updates. The team is actively investigating and has created a Colab notebook for optimization work.
Duplicate of #2433