AppEngine 警告 - OpenBLAS 警告 - 无法确定此系统上的 L2 缓存大小

AppEngine warning - OpenBLAS WARNING - could not determine the L2 cache size on this system

我尝试在 GC AppEngine 上部署应用程序。部署过程中没有错误,但应用程序无法运行(仅显示加载页面)。 日志中唯一一个奇怪的raw

OpenBLAS WARNING - could not determine the L2 cache size on this system

顺便说一句 - 它在我的本地机器上运行良好。
这是 python 基于 Dash 框架的网络应用程序

我的app.yaml:

runtime: python37
service: service-name
instance_class: F2

entrypoint: gunicorn -b :$PORT main:app.server

Requirements.txt:

Flask==1.0.2
dash==0.34.0
dash-html-components==0.13.4
dash-core-components==0.41.0
dash-table==3.1.11
gunicorn==19.9.0
google-cloud-pubsub==0.37.2
requests==2.21.0
pandas==0.23.4

我刚刚遇到了与 pandas 和 Dash 相同的问题,并找到了你的问题(希望它能给我一些启示)。卡了几个小时终于找到答案了,回来分享:-)

如果您看到的唯一错误是 OpenBLAS 警告,则很可能该应用运行良好。调试了几个小时后,我发现由于 Dash 和 Pandas 消耗大量内存,F2 实例无法正常处理 Web 应用程序,并因 RAM 内存不足而失败。请尝试在您的 YAML/JSON 配置文件中将您的实例更改为具有更多 RAM 内存的最高可能的自动单元,然后它可能会工作:

instance_class: F4_HIGHMEM

编辑:Google App Engine 现在支持更多实例类型。查看实例类型的文档:standard instances

此外,请记住,您是第一次 运行 此网络应用程序,执行时间会长得多。如果您检查日志,您将看到如下几个提示。再等一下

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.

我个人通过给 gunicorn 添加超时来解决它,因为默认超时只有 30 秒

entrypoint: gunicorn -b :$PORT main:app.server --timeout 120

我在尝试以下操作时找到了这个解决方案:

  • 从 F1 切换到 F4_1G 实例:仍然有相同的警告
  • 从 App Engine Standard 切换到 App Engine Flexible 环境(我强烈不推荐,因为 App Engine Flexible 实例未正确关闭(删除)可能会花费您很多钱:请参阅此处以供参考 ), with 16gb of ram and 4 CPU -> eventually got a different warning "[CRITICAL] WORKER TIMEOUT" which pointed me to this post: Gunicorn worker timeout error ,这是我找到这个解决方案的地方。

现在我的应用运行良好,即使使用 F1 实例也是如此

别忘了更改工人数量! AppEngine 实例中有一个默认的 worker 数量,因此您的应用程序在同一个实例上乘以这个数量

https://cloud.google.com/appengine/docs/standard/python3/runtime