Python 在Google App Engine上使用基本缩放/手动缩放的Dash应用程序
我的Dash应用程序在自动缩放类型上与GAE配合得非常好。我的app.yaml只是:Python 在Google App Engine上使用基本缩放/手动缩放的Dash应用程序,python,google-app-engine,flask,plotly-dash,hyphen,Python,Google App Engine,Flask,Plotly Dash,Hyphen,我的Dash应用程序在自动缩放类型上与GAE配合得非常好。我的app.yaml只是: runtime: python38 instance_class: F4_1G entrypoint: gunicorn --timeout 2400 -b :$PORT application:application 但事实证明,一些计算超出了为自动缩放类型设置的10分钟限制 因此,我读到解决方案是要么加快我的代码(我不认为这是低效的),要么切换到手动/基本缩放,这没有10分钟的超时时间 我已尝试将app.
runtime: python38
instance_class: F4_1G
entrypoint: gunicorn --timeout 2400 -b :$PORT application:application
但事实证明,一些计算超出了为自动缩放类型设置的10分钟限制
因此,我读到解决方案是要么加快我的代码(我不认为这是低效的),要么切换到手动/基本缩放,这没有10分钟的超时时间
我已尝试将app.yaml更改为:
runtime: python38
instance_class: B4_1G
basic_scaling:
max_instances: 1
idle_timeout: 25m
entrypoint: gunicorn --timeout 2400 -b :$PORT application:application
但在访问网站时,我得到的只是:
错误:服务器错误服务器遇到错误,无法运行
完成您的请求。请在30秒后重试
谷歌日志查看器显示:
E 2020-10-14T10:48:20.982385Z GET 403 135 B 23.2 s Unknown /_ah/start
A 2020-10-14T10:48:23.327231Z [2020-10-14 10:48:23 +0000] [10] [INFO] Starting gunicorn 20.0.4
A 2020-10-14T10:48:23.329063Z [2020-10-14 10:48:23 +0000] [10] [INFO] Listening at: http://0.0.0.0:8081 (10)
A 2020-10-14T10:48:23.329085Z [2020-10-14 10:48:23 +0000] [10] [INFO] Using worker: sync
A 2020-10-14T10:48:23.602018Z [2020-10-14 10:48:23 +0000] [17] [INFO] Booting worker with pid: 17
A 2020-10-14T10:48:34.192067Z OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
A 2020-10-14T10:48:44.211122Z [2020-10-14 10:48:44 +0000] [10] [INFO] Handling signal: term
A 2020-10-14T10:48:44.218051Z [2020-10-14 10:48:44 +0000] [17] [INFO] Worker exiting (pid: 17)
E 2020-10-14T10:48:44.241493Z GET 403 135 B 27.7 s Unknown /_ah/start
A 2020-10-14T10:48:44.617622Z [2020-10-14 10:48:44 +0000] [10] [INFO] Shutting down: Master
A 2020-10-14T10:48:47.486868Z [2020-10-14 10:48:47 +0000] [10] [INFO] Starting gunicorn 20.0.4
A 2020-10-14T10:48:47.487984Z [2020-10-14 10:48:47 +0000] [10] [INFO] Listening at: http://0.0.0.0:8081 (10)
A 2020-10-14T10:48:47.488006Z [2020-10-14 10:48:47 +0000] [10] [INFO] Using worker: sync
A 2020-10-14T10:48:47.781489Z [2020-10-14 10:48:47 +0000] [17] [INFO] Booting worker with pid: 17
A 2020-10-14T10:49:03.100870Z OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
A 2020-10-14T10:49:11.991812Z [2020-10-14 10:49:11 +0000] [10] [INFO] Handling signal: term
A 2020-10-14T10:49:11.996679Z [2020-10-14 10:49:11 +0000] [17] [INFO] Worker exiting (pid: 17)
E 2020-10-14T10:49:12.105306Z GET 403 135 B 10 s Unknown /_ah/start
A 2020-10-14T10:49:12.398334Z [2020-10-14 10:49:12 +0000] [10] [INFO] Shutting down: Master
A 2020-10-14T10:49:14.560845Z [2020-10-14 10:49:14 +0000] [10] [INFO] Starting gunicorn 20.0.4
A 2020-10-14T10:49:14.562372Z [2020-10-14 10:49:14 +0000] [10] [INFO] Listening at: http://0.0.0.0:8081 (10)
A 2020-10-14T10:49:14.562602Z [2020-10-14 10:49:14 +0000] [10] [INFO] Using worker: sync
A 2020-10-14T10:49:14.732882Z [2020-10-14 10:49:14 +0000] [17] [INFO] Booting worker with pid: 17
A 2020-10-14T10:49:18.757532Z OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
A 2020-10-14T10:49:22.157248Z [2020-10-14 10:49:22 +0000] [10] [INFO] Handling signal: term
A 2020-10-14T10:49:22.164939Z [2020-10-14 10:49:22 +0000] [17] [INFO] Worker exiting (pid: 17)
A 2020-10-14T10:49:22.666466Z [2020-10-14 10:49:22 +0000] [10] [INFO] Shutting down: Master
有人有什么想法吗?警告“OpenBLAS警告-无法确定此系统上的二级缓存大小,假设256k”通常在内存不足时出现。遇到错误时内存使用情况如何?它是否达到了实例类'B4_1G'的限制?F4_1G(在那里工作正常)和B4_1G都有2gb,所以我认为它可能不是内存。此时内存使用率非常低,只是显示一个首页菜单。日志显示错误是在引导工作程序时生成的。您能在启动工作程序时检查内存消耗吗?请检查您的应用程序代码和依赖项。还值得尝试使用App Engine Flexible environment,使用更多内存设置资源设置,或者在Google Compute Engine上创建一个VM实例来部署您的应用程序,看看它们是否有助于解决问题。