java - JAVA GAE:进程终止,因为机器被强制关闭
问题描述
我的 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>
任何的想法?问候
解决方案
不确定为什么它会在您的 GAE 中发生,但是,根据App Engine 服务水平协议,GAE 承诺的每月正常运行时间百分比为“至少 99.95%”。
“每月正常运行时间百分比”是指一个月内的总分钟数,减去一个月内所有停机时间段遭受的停机时间的分钟数,再除以一个月内的总分钟数。
因此,这可能是一种预期行为,但是,如果您认为这种情况发生得更频繁,我建议您联系 GCP 技术支持以进行更详细的检查。
此外,您可能希望增加应用配置中的max-instances参数,因为更多实例将有助于更好的加载过程,因此如果一个实例失败,其他实例将继续工作。
推荐阅读
- postgresql - 在数组类型上使用 EF.Functions.Like 时,EF Core 抛出异常
- windows - 批处理文件:冒号总是以文字输出结尾
- java - Android Studio 无法导入 com.google.gms.googleservices.GoogleServicesPlugin
- c++ - 如何在 if 语句中比较 int 变量和 string 变量
- wordpress - 在另一个页面中渲染块时如何加载古腾堡块样式
- ios - UIBezierPath 在故事板和模拟器中绘制不同
- python - 为什么在这个例子中 pcolor 会输出一个镜像数组?
- python - Tesseract-OCR 无法识别数字
- ruby-on-rails - 环境变量未加载到应用程序中?
- python - 使用 tqdm 的状态栏