Hello Alan,
As you have pointed out from the
documentation: (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 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.