简体   繁体   English

Google App Engine-始终运行的实例

[英]Google App Engine - Always running instance

I want my App Engine to always have one instance running. 我希望我的App Engine始终运行一个实例。 I want to avoid that the first request after 15 minutes of no traffc takes like 20 seconds to finish. 我想避免在15分钟无交通后的第一个请求需要20秒才能完成。 There is a feature called "Always on" that is mentioned several places to fix this, but I can't find it anywhere on App Engine. 有一项名为“ Always on”(始终在线)的功能,其中提到了几个要解决此问题的地方,但我在App Engine的任何地方都找不到它。

I've tried to set min-idle-instances to 1 but it still starts a new instance after 15 minutes of no traffic. 我尝试将min-idle-instances设置为1,但在15分钟内没有流量后,它仍然会启动一个新实例。 Any suggestions? 有什么建议么?

"Always-on" is deprecated (I believe it does not exist any more). 不建议使用“始终在线”(我相信它不再存在)。 The configurations that currently let you do that, and more, are documented at https://cloud.google.com/appengine/docs/java/modules/ ; https://cloud.google.com/appengine/docs/java/modules/中记录了当前允许您执行的操作以及更多操作。 for example if you always want one instance running, neither more nor less, set the default module of your app to manual scaling, with instances set to 1 . 例如,如果您始终希望运行一个实例(既不多也不少),则将应用程序的默认模块设置为手动缩放, instances设置为1

However, automatic scaling with min-idle-instances should also work if you have followed the instructions (at the URL I just gave) 但是, 如果您按照说明进行操作(使用我刚刚提供的网址),则使用min-idle-instances自动缩放也应该有效

For resident instances to function properly, you must be sure that warmup requests are enabled and your application handles warmup requests. 为了使常驻实例正常运行,必须确保启用了预热请求,并且您的应用程序可以处理预热请求。

Use, again as that URL recommends, "The Availability column of the Developers Console Instance page" to check which of your instances are actually resident (as you wish) rather than dynamic (ie, going away after some idle time). 再次使用该URL所建议的,请使用“开发人员控制台实例页面的可用性列”,以检查您的实例中的哪些实际上是实际resident (如您所愿),而不是dynamic (即,在闲置一段时间后消失)。

You might want to use AppEngine Managed VM. 您可能要使用AppEngine托管的VM。 The application interface is compatible, but you get a VM that's always on. 该应用程序接口是兼容的,但是您可以获得始终处于运行状态的VM。 For more information see https://cloud.google.com/appengine/docs/managed-vms . 有关更多信息,请参见https://cloud.google.com/appengine/docs/managed-vms

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM