如何解决App 引擎在大约 10 分钟后关闭并启动
由于某种原因,应用引擎有时会关闭(到目前为止,它在不同日期发生了 3 次),然后在 10 分钟后启动(手动停止和启动实例需要大约 1 分钟,所以这看起来很长)。
>之前没有错误或其他指示关闭原因的日志(在关闭之前没有出现 ah/stop)。
应用在手动缩放模式下运行,在标准应用引擎上有 1 个实例。应用程序大部分时间处于“空闲”状态(它确实运行但不接收请求。)运行时为 java11。
可能是什么原因?
2021-06-21 23:45:25.372 EDT
[start] 2021/06/22 03:45:25.371929 Quitting on terminated signal
Default
2021-06-21 23:45:25.373 EDT
I0622 03:45:25.373024 24 statistician.cc:113] Statistics of class_prepare_time_micros: mean = 10.4196,stdev = 31.173,min = 2,max = 1046,samples = 3203
Default
2021-06-21 23:45:25.710 EDT
I0622 03:45:25.381978 1340 jvmti_agent.cc:222] Java VM termination
Default
2021-06-21 23:45:25.711 EDT
I0622 03:45:25.384263 29 jvmti_agent_thread.cc:99] Agent thread exited: CloudDebugger_main_worker_thread
Default
2021-06-21 23:45:25.711 EDT
I0622 03:45:25.387276 1340 worker.cc:113] Debugger threads terminated
Default
2021-06-21 23:45:25.712 EDT
I0622 03:45:25.387315 1340 jvmti_agent.cc:236] JvmtiAgent::JvmtiOnVMDeath cleanup time: 5348 microseconds
Default
2021-06-21 23:45:25.811 EDT
[start] 2021/06/22 03:45:25.810839 Start program failed: termination triggered by nginx exit
Info
2021-06-21 23:54:58.069 EDT
GET
200
111 B
5.896 s
/_ah/start
2021-06-21 23:45:25.372 EDT
[start] 2021/06/22 03:45:25.371929 Quitting on terminated signal
Default
2021-06-21 23:45:25.811 EDT
[start] 2021/06/22 03:45:25.810839 Start program failed: termination triggered by nginx exit
Default
2021-06-21 23:54:58.440 EDT
[start] 2021/06/22 03:54:58.438391 Starting app
Default
2021-06-21 23:54:58.441 EDT
[start] 2021/06/22 03:54:58.440653 Executing: /bin/sh -c exec serve /workspace/ingest.jar
Default
2021-06-21 23:54:58.445 EDT
[start] 2021/06/22 03:54:58.445422 Waiting for network connection open. Subject:"app/invalid" Address:127.0.0.1:8080
Default
2021-06-21 23:54:58.446 EDT
[start] 2021/06/22 03:54:58.445915 Waiting for network connection open. Subject:"app/valid" Address:127.0.0.1:8081
Default
2021-06-21 23:54:58.483 EDT
[serve] 2021/06/22 03:54:58.482876 Serve started.
Default
2021-06-21 23:54:58.485 EDT
[serve] 2021/06/22 03:54:58.483776 Args: {runtimeLanguage:java runtimeName:java11 memoryMB:512 positional:[/workspace/ingest.jar]}
Default
2021-06-21 23:54:58.487 EDT
[serve] 2021/06/22 03:54:58.486069 Running /bin/sh -c exec java -agentpath:/opt/cdbg/cdbg_java_agent.so=--log_dir=/var/log -jar /workspace/ingest.jar
Default
2021-06-21 23:54:59.702 EDT
[start] 2021/06/22 03:54:59.701720 Wait successful. Subject:"app/valid" Address:127.0.0.1:8081 Attempts:251 Elapsed:1.255602687s
Default
2021-06-21 23:54:59.702 EDT
[start] 2021/06/22 03:54:59.701951 Starting nginx
Default
2021-06-21 23:54:59.711 EDT
[start] 2021/06/22 03:54:59.710592 Waiting for network connection open. Subject:"nginx" Address:127.0.0.1:8080
Default
2021-06-21 23:54:59.753 EDT
[start] 2021/06/22 03:54:59.745519 Wait successful. Subject:"nginx" Address:127.0.0.1:8080 Attempts:5 Elapsed:33.709637ms
谢谢!
解决方法
如果一段时间内没有请求进来,GAE 将关闭。如果您想保持实例运行,则必须考虑配置 min_idle_instances
。见this document。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。