How do you keep a running instance for Google App

2019-07-09 01:03发布

It seems the google app engine and developers console has changed again. I can not figure out how to keep a instance for google app engine running, even when the site is idol. There use to be a slider for this under the app engine settings, but this is no longer there. I think in Google Speak I have dynamic instances and I need one resident instance to start with. The first hit on the site is just taking way too long.

2条回答
SAY GOODBYE
2楼-- · 2019-07-09 01:50

The instance uptime depends on the type of scaling configured for the respective module. Only manual and basic scaling module instances can be resident. Selecting a module scaling type is done via the respective module's configuration file.

You may also want to take a look at warmup requests, which would help reduce the response times when additional instances are started besides the very first/resident instance.

查看更多
劳资没心,怎么记你
3楼-- · 2019-07-09 01:54

While the answer provided by Dan is correct - module type determines the scaling - you probably want to keep at least one instance of your default module with "automatic scaling" around on a low traffic site.

You can setup a cron job and ping your webapp every minute as a way to achieve this.

A more costly approach would be to set min-idle-instances to 1 for your default module. But you will have 2 instances (the idle instance becomes no longer idle, so GAE spins up a new idle one) as soon as there is traffic on your site.

For a low traffic site, I would also suggest setting min-pending-latency a bit higher (like 5 secs) and concurrent requests high enough to prevent spinning up new instances if multiple Ajax requests are fired on your homepage. This will ensure that the single instance will serve them all, and no extra instances start spinning up too soon.

查看更多
登录 后发表回答