Google App Engine Django 应用程序间歇性崩溃,但日志文件没有显示原因

Google app engine Django app is crashing intermittently but the log files aren't showing me why

我在 google 应用程序引擎上有一个 Django 4.0 应用程序 运行,大部分情况下它运行良好。但是,我有一个特定的页面,在我多次加载该页面后似乎使应用程序崩溃。在我的笔记本电脑上,我没有看到这种行为,所以我试图调试在 GAE 上 运行 时出现的问题,但我对正在发生的事情没有太多了解。查看日志并没有告诉我任何有趣的事情,只是工作人员正在关闭然后他们正在重新启动:

gcloud app logs tail -s default

2022-01-26 16:02:38 default[fixeddev]  2022-01-26 08:02:38,933 common.views INFO     Application started
2022-01-26 16:03:40 default[fixeddev]  "GET /organization/clean_up_issues/ HTTP/1.1" 200
2022-01-26 16:03:56 default[fixeddev]  "GET /organization/clean_up_issues/ HTTP/1.1" 200
2022-01-26 16:04:10 default[fixeddev]  "GET /organization/clean_up_issues/ HTTP/1.1" 500
2022-01-26 16:04:15 default[fixeddev]  [2022-01-26 16:04:15 +0000] [12] [INFO] Handling signal: term
2022-01-26 16:04:15 default[fixeddev]  [2022-01-26 08:04:15 -0800] [22] [INFO] Worker exiting (pid: 22)
2022-01-26 16:04:15 default[fixeddev]  [2022-01-26 08:04:15 -0800] [25] [INFO] Worker exiting (pid: 25)
2022-01-26 16:04:15 default[fixeddev]  [2022-01-26 08:04:15 -0800] [27] [INFO] Worker exiting (pid: 27)
2022-01-26 16:09:49 default[fixeddev]  "GET /_ah/start HTTP/1.1" 200
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [10] [INFO] Starting gunicorn 20.1.0
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [10] [INFO] Listening at: http://0.0.0.0:8081 (10)
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [10] [INFO] Using worker: gthread
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [21] [INFO] Booting worker with pid: 21
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [24] [INFO] Booting worker with pid: 24
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [25] [INFO] Booting worker with pid: 25
2022-01-26 16:09:49 default[fixeddev]  [2022-01-26 16:09:49 +0000] [26] [INFO] Booting worker with pid: 26
2022-01-26 16:09:50 default[fixeddev]  OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2022-01-26 16:09:50 default[fixeddev]  OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2022-01-26 16:09:50 default[fixeddev]  OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2022-01-26 16:09:50 default[fixeddev]  OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
2022-01-26 16:09:53 default[fixeddev]  2022-01-26 08:09:53,151 common.views INFO     Application started

我从哪里可以更清楚地了解这些崩溃期间实际发生的情况?我对 GAE 比较陌生,感觉自己在盲目调试,因为我无法在我的本地开发机器上重现这个问题,并且没有记录异常。每次崩溃只会产生 500。

不相关的奖金回合问题:有人知道如何处理 OpenBLAS 警告吗?这是一个真正的问题还是我似乎无法抑制的麻烦?

App 引擎错误代码 500(内部服务器错误),几乎总是意味着您的 python 代码引发了运行时捕获的未经处理的异常。

转到 App Engine 仪表板并查找错误 - 客户端错误、服务器错误。

从您收到的错误消息来看,您的应用使用的内存似乎超过了您的实例可以处理的内存。由于内存不足,这会导致错误。

您得到的唯一错误是:

2022-01-26 16:09:50 default[fixeddev] OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k

您的应用可能仍然可以使用。我建议您更改 instance class 以获得更多可用内存并避免错误。