简体   繁体   English

如何停止谷歌云应用引擎重新启动 discord.python 机器人?

[英]How to stop google cloud app engine to restart the discord python bot?

I made a discord.python bot and deploy to google cloud app engine but the problem is it restarts every 10 minutes.我制作了一个 discord.python 机器人并部署到谷歌云应用引擎,但问题是它每 10 分钟重新启动一次。

app.yaml

runtime: python310

instance_class: B1

manual_scaling:
  instances: 1

entrypoint: python3 bot.py

Error

Process terminated because it failed to respond to the start request with an HTTP status code of 200-299 or 404.

How to fix the problem?如何解决这个问题?

As per App Engine officials docs , App engine sends periodic health check requests to confirm that an instance is running, and to check that an instance is fully started and ready to accept incoming requests.根据 App Engine 官方文档,App 引擎定期发送健康检查请求以确认实例正在运行,并检查实例是否已完全启动并准备好接受传入请求。 By default, these health checks are enabled and are known as split health checks .默认情况下,这些健康检查是启用的,称为拆分健康检查 An instance that receives a health check must answer the health check within a specified time interval.收到健康检查的实例必须在指定的时间间隔内回答健康检查。

As the instance goes through these health checks, if the instance is healthy it works fine but if the instance is unhealthy then it restarts.当实例通过这些健康检查时,如果实例健康,它可以正常工作,但如果实例不健康,它就会重新启动。

Official docs says:官方文档说:

Unhealthy.不良。 The instance refused the health check requests and failed to respond to a specified number of consecutive health check requests.实例拒绝健康检查请求,连续指定次数的健康检查请求响应失败。 App Engine continues to send health check requests and restarts the instance if an unhealthy instance continues to fail to respond to a predetermined number of consecutive health checks.如果运行状况不佳的实例继续无法响应预定数量的连续运行状况检查,App Engine 会继续发送运行状况检查请求并重启实例。

Requesting you to try by setting min and max instances in automatic scaling or else use basic scaling as per this doc .要求您尝试在自动缩放中设置最小和最大实例,或者按照此文档使用基本缩放。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 App Engine Flex (Python 3.7) 中本地模拟 Google 云任务服务? - How to emulate Google cloud tasks service locally in app engine flex (Python 3.7)? 如何为 Google Cloud App Engine 任务处理程序进行身份验证 - How to authenticate for Google Cloud App Engine task handlers 如何在 Google App Engine 中调试 gunicorn 和 python? - How to debug gunicorn and python in Google App Engine? 如何将 Helidon 应用程序部署到 Google Cloud App Engine? - How to deploy a Helidon application to Google Cloud App Engine? 如何分析 Google App Engine python27 运行时(不是 python) - How to profile Google App Engine python27 runtime (not python) Quarkus 部署到 Google Cloud App 引擎失败 - Quarkus deployment to Google Cloud App engine fails Google Cloud App Engine 中的 Angular 7 路由不起作用 - Angular 7 Routing in Google Cloud App Engine not working Spring 在 Google Cloud App Engine 上启动托管 - Spring Boot hosting on Google Cloud App Engine 何时使用 Google App Engine Flex 与 Google Cloud Run - When to use Google App Engine Flex vs Google Cloud Run 如何在 Google App Engine 标准环境中使用 Google Cloud Build 或其他方法设置环境变量? - How to set environment variables using Google Cloud Build or other method in Google App Engine Standard Environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM