【问题标题】:Google app engine Django app is crashing intermittently but the log files aren't showing me whyGoogle 应用引擎 Django 应用间歇性崩溃,但日志文件没有显示原因
【发布时间】:2022-01-26 17:30:39
【问题描述】:

我有一个在谷歌应用引擎上运行的 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 警告吗?这是一个真正的问题还是只是一个我似乎无法抑制的麻烦?

【问题讨论】:

    标签: django google-app-engine google-app-engine-python


    【解决方案1】:

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

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

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

    你得到的唯一错误是:

    2022-01-26 16:09:50 default[fixeddev] OpenBLAS 警告 - 无法确定此系统上的 L2 缓存大小,假设为 256k

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 2014-09-15
      • 2014-07-05
      • 2012-11-15
      相关资源
      最近更新 更多