I realize this is not the Cloud Run group, but that's the closest to it.

I've asked my question on Stackoverflow, but the solution(s) posted there 
were not helpful.

*My issue*: I have a Flask (Python 3.6) REST API that I'm deploying on 
Cloud Run. The first thing my server does at startup is to load two large 
Pandas dataframes into memory. Until those two global objects are loaded, 
the API is not useful. I have a health check defined in my Dockerfile that 
helps with this - until the two dataframes are loaded, the health check is 
not healthy. The problem is that when I deploy a new revision on Cloud Run, 
it will start delivering traffic to my container before it's actually fully 
loaded, and thus, the first several requests to the API will take 10-15 
seconds.

I've optimized this startup step about as much as it can before things 
become completely ridiculous and unreasonable, and yet, this is the best I 
can do.

*My question*: is there a way to help Cloud Run know that the container is 
still loading and shouldn't be taking traffic yet? Something along the 
lines of: load the container, but don't add it to the load balancer yet, 
since the status is not yet "healthy"?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e605e103-f7dc-42c8-87ba-6cb3f01c8b91%40googlegroups.com.
  • [google-appengine... Rodrigo Silveira

Reply via email to