Hi, thanks for your response!

I would love to decrease the startup time. I assumed there wasn't any way I 
could decrease it much, since I'm basically just running a simple Flask 
server with mostly default app configuration. It does have some third-party 
package dependencies, but I don't know of any reason why they'd be that 
slow to load. When I run it locally for development, it starts up in less 
than a second. (I don't use gunicorn locally; maybe I'll try that and see 
if it's slow.)

It's been a while since I ran a simple Standard Environment Python app with 
automatic scaling, and when I did it was probably old-school Python 2.x. I 
think they used to start up pretty quickly, but I didn't know if it would 
be the same in newer environments.

I'm on vacation this week, but maybe next week I'll experiment with adding 
some extra logging before any dependencies are loaded, and when Flask 
actually starts serving. It would be interesting to see the timing on that.

I could play with gunicorn configuration, but I assumed the defaults were 
reasonable.

Meanwhile, my coworkers and I actually decided it was a good idea to 
increase the minimum instances anyway, so this isn't really bothering us 
now, but it would be nice to solve the mystery. 

Thanks!

Alan

On Wednesday, August 12, 2020 at 9:00:55 PM UTC-4, Elliott (Cloud Platform 
Support) wrote:
>
> Hello Alan,
>
> As you have pointed out from the documentation 
> <https://cloud.google.com/appengine/docs/standard/python3/how-instances-are-managed>:
>  
> (I know you’ve read it but please bear with me.)
>
> App Engine attempts to keep manual and basic scaling instances running 
> indefinitely. However, at this time there is no guaranteed uptime for 
> manual and basic scaling instances. Hardware and software failures that 
> cause early termination or frequent restarts can occur without prior 
> warning and can take considerable time to resolve; thus, you should 
> construct your application in a way that tolerates these failures.
>
> *You would like to know if App Engine can resist shutting down the 
> instance before spinning up a new one. This information is not available in 
> public documentation and from what is happening in your scenario, I believe 
> I would have to reach out to an App Engine Specialist to confirm. I want to 
> make sure.
>
> You have provided a workaround to this behavior to set up more instances 
> but you would like to know what are your other options. (Again, please bear 
> with me.)
>
> From the documentation I included 
> <https://cloud.google.com/appengine/docs/standard/python3/how-instances-are-managed>
>  
> you may:
>
> Reduce the amount of time it takes for your instances restart or for new 
> ones to start.
>
> For long-running computations, periodically create checkpoints so that you 
> can resume from that state.
>
> Your app should be "stateless" so that nothing is stored on the instance.
>
> Use queues for performing asynchronous task execution.
>
> If you configure your instances to manual scaling:
> Use load balancing across multiple instances.
>
> Configure more instances than required to handle normal traffic.
> Write fall-back logic that uses cached results when a manual scaling 
> instance is unavailable.
>
> So to summarize right now with the information I have, you have two 
> options. The first and more direct is to create another instance that would 
> affect your budget and the other to look at the advice for your application.
>
> You also have another issue where it may take 30 seconds to warm up an 
> instance. This information is private and would require looking at your 
> project. I can help you as much as I can using this forum but sharing 
> specific information about your project is not good for security.
>
> I will wait for your response.
>
>
>
>
>

-- 
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/f8bd681b-d7ae-4596-aba0-1fe39094cb02o%40googlegroups.com.
  • [google-appengine... Alan deLespinasse
    • [google-appe... 'Elliott (Cloud Platform Support)' via Google App Engine
      • [google-... Alan deLespinasse
        • [goo... Alan deLespinasse
          • ... 'Elliott (Cloud Platform Support)' via Google App Engine

Reply via email to