gpt4 book ai didi

java - 谷歌应用引擎 : how often does a "runtime startup" occur

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:11:51 27 4
gpt4 key购买 nike

我计划在 Google AppEngine/Java 上托管 JRuby on Rails 应用程序。我找到了 a great blog post by Ola Bini关于如何做到这一点,但在总结中他说:

Overall, JRuby on Rails works very well on the App Engine, except for some smaller details. The major ones are the startup cost and testing. As it happens, you can’t actually get GAE/J to precreate things. Instead you’ll have to let the first release take the hit of this. Now, GAE/J does a let of preverifying of bytecodes and so on, so startup is a bit more heavy than on other JDKs. One runtime takes about 20 seconds wall time to startup, so the first hit takes some time.

这个我不是很懂。在什么情况下,运行时需要多久启动一次?正常的 20 秒滞后可能是一个问题。

最佳答案

只要需求超过当前运行的实例,App Engine 就会为您启动新的运行时。当需求较低时,它将关闭实例。最终,这意味着如果您的应用在一定时间内未被使用,您的所有实例可能会被关闭。然后,下次用户尝试访问您的应用时,将需要启动一个新实例,或者如某些人所说的那样“启动”。

截至 3 月,应用引擎团队不会就实例将持续多长时间给出任何官方估计:

7:40pm] nwinter:  Is it possible to get a rough estimate of how long an appinstance 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 bemeaningful, 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 fewseconds or a few hours?  Just curious[7:43pm] dan_google: nwinter: Apps are evicted by least-recently-used on anapp server.  As someone noted recently (forums or chat I forget), lowtraffic could mean lots of "restarts", but so could spikes in traffic whichmay 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 Imean, request patterns, other apps on each app server, and so forth.  Notreally predictable. 

这是与应用引擎团队的聊天记录。我已经删除了成绩单中不相关的行,例如“某某登录”。可以找到完整的成绩单 here

关于java - 谷歌应用引擎 : how often does a "runtime startup" occur,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1137786/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com