【问题标题】:JAVA GAE: Process terminated because the machine was forced to shutdownJAVA GAE:进程终止,因为机器被强制关闭
【发布时间】:2020-12-21 07:00:25
【问题描述】:

我的 java 应用程序在 GAE 上运行了很长时间。今天应用程序返回了 500,而 appengine 日志只显示消息:

"Process terminated because the machine was forced to shutdown" 

我找不到任何文档来解释该消息的原因。

关于关机生命周期的唯一文档是https://cloud.google.com/appengine/docs/standard/java/how-instances-are-managed#shutdown

Shutdown

The shutdown process might be triggered by a variety of planned and unplanned events, such as:

    You manually stop an instance.
    You deploy an updated version to the service.
    The instance exceeds the maximum memory for its configured instance_class.
    Your application runs out of Instance Hours quota.
    Your instance is moved to a different machine, either because the current machine that is running the instance is restarted, or App Engine moved your instance to improve load distribution.

嗯,唯一合理的原因是最后一个,但是,我不相信消息指的是“应用引擎移动了您的实例......”

我的应用程序配置:

<instance-class>B4_HIGHMEM</instance-class>
<runtime>java8</runtime>
<basic-scaling>
    <max-instances>1</max-instances>
    <idle-timeout>1m</idle-timeout>
</basic-scaling>

有什么想法吗? 问候

【问题讨论】:

    标签: java google-app-engine google-cloud-platform


    【解决方案1】:

    不确定为什么您的 GAE 会发生这种情况,但是,根据 App Engine Service Level Agreement,GAE 承诺的每月正常运行时间百分比是“至少 99.95%”

    “每月正常运行时间百分比”是指一个月内的总分钟数, 减去所有停机时间造成的停机时间分钟数 一个月的时间段,除以一个月的总分钟数。

    因此,这可能是一种预期行为,但是,如果您认为这种情况发生得更频繁,我建议您联系 GCP 技术人员support 进行更详细的检查。


    此外,您可能希望在应用配置中增加 max-instances 参数,因为更多实例将有助于更好地加载过程,因此如果一个实例失败,其他实例将继续工作。

    【讨论】:

      【解决方案2】:

      当 App Engine 实例无法处理请求并因此崩溃/死机时,将出现 500s 错误。 GAE 可能正在处理 long-running requests,这可能需要一段时间才能完成。

      有点上下文,App Engine 在为请求提供服务时会创建沙盒实例,有时这些实例可能会崩溃、更改或关闭,然后最终可能会出现其他错误。

      虽然预计此问题不会经常发生,但它可能由不同的原因引起。我建议您查看您之前共享的documentation,并仔细检查列表中的项目以及长期请求。

      【讨论】:

        猜你喜欢
        • 2013-09-20
        • 2015-04-29
        • 2013-04-24
        • 1970-01-01
        • 2012-09-26
        • 2011-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多