Google AppEngine:"运行时启动"发生的频率

Use*_* 42 6 java google-app-engine

我打算在Google AppEngine/Java上托管一个JRuby on Rails应用程序.我找到了Ola Bini关于如何做到这一点的精彩博文,但在摘要中他说:

总体而言,JRuby on Rails在App Engine上运行良好,除了一些较小的细节.主要是启动成本和测试.碰巧的是,你实际上无法让GAE/J预先创建东西.相反,你必须让第一个版本受到影响.现在,GAE/J可以预先验证字节码等,因此启动比其他JDK更重.一个运行时需要大约20秒的启动时间,因此第一次启动需要一些时间.

我不完全理解这一点.在什么情况下,运行时需要多长时间才能启动?常规的20秒滞后可能是一个问题.

Pet*_*ore 7

当需求超过当前运行的实例时,App Engine将为您启动新的运行时.然后,当需求降低时,它将关闭实例.最终,这意味着如果您的应用程序在一段时间内未使用,则可以关闭所有实例.然后,下次用户尝试访问您的应用时,需要启动一个新实例,或者像某些人所说的那样"旋转".

截至3月,应用引擎团队不会对实例保持多久的任何官方估计:


7:40pm] nwinter:  Is it possible to get a rough estimate of how long an app
instance will stick around once spawned?
[7:40pm] marzia_google: @nwinter, not really
[7:40pm] marzia_google: there are no garuntees
[7:41pm] nwinter:  No average time or anything?
[7:42pm] marzia_google: @nwinter i'm not sure an average time would be
meaningful, even if i knew off hand what it was ( i don't)
[7:42pm] marzia_google: since it really can be quite variable
[7:42pm] Kardax: Re instance lifetime: So an app instance could last a few
seconds or a few hours?  Just curious
[7:43pm] dan_google: nwinter: Apps are evicted by least-recently-used on an
app server.  As someone noted recently (forums or chat I forget), low
traffic could mean lots of "restarts", but so could spikes in traffic which
may start new instances on multiple app servers.
[7:43pm] nwinter:  @dan_google: good to know!
[7:43pm] dan_google: Kardax: Yes, depending on the weather.  By which I
mean, request patterns, other apps on each app server, and so forth.  Not
really predictable. 

这是与应用引擎团队聊天的记录.我删除了成绩单中的非相关行,例如"so so so logged in".完整的成绩单可以在这里找到