为什么我的任务在 Google 的 App Engine 中失败?

Why is my task failing in Google's App Engine?

我的两个 12 小时任务中的一个作为从 API 端点到 Snowflake 数据库的 ETL,每周大约有 3-4 次失败,我无法弄清楚原因。

Cron 任务管理器说它在今天早上 6:29am 最后 运行 但在检索日志时只有一行说:

This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

我不确定我是否需要热身,分配特定的工人等,因为单行错误的日志对我来说太无用了。我正在使用一个相当大的实例 class 我希望能够处理大部分工作量。

成功 运行 的日志如下所示:

https://github.com/markamcgown/GF/blob/main/downloaded-logs-success2.csv

失败:

https://github.com/markamcgown/GF/blob/main/downloaded-logs-20210104-074656.csv

App.yaml:

service: vetdata-loader
runtime: python38

instance_class: F4_1G

handlers:

- url: /task/loader
  script: auto

已更新,这是我最近的 app.yaml,现在失败的次数减少了,但有时还是会失败:

service: vetdata-loader
runtime: python38

instance_class: B4_1G

handlers:

- url: /task/loader
  script: auto

basic_scaling:
  max_instances: 11
  idle_timeout: 30m

我认为您没有使用正确的实例 class。如果您看一下 here about the timeouts and the task call,自动缩放的呼叫时间限制为 10 分钟,基本和手动缩放的呼叫时间限制为 24 小时。

如果我拿你的instance_class,FXXX类型是suitable for automatic scaling。请改用 B4_1G 实例 class 并检查您是否仍然遇到这些问题。你不应该。