google-app-engine - App Engine Standard Nodejs8 ignore memory_gb in resources
问题描述
I'm trying to deploy a Nodejs8, memory intense app on Google App Engine Standard.
This is my app.yaml
:
runtime: nodejs8 resources: cpu: 1 memory_gb: 6 disk_size_gb: 10
This is my deploy command:
gcloud app deploy --project=my-project --version=0-0-12
This is the error I get when I try to access the relevant endpoint of the app:
Exceeded soft memory limit of 128 MB with 182 MB after servicing 0 requests total. Consider setting a larger instance class in app.yaml.
How come the memory_gb
param is ignored? What do I need to do in order to enlarge the memory of the instances?
解决方案
您正在尝试将灵活的环境资源设置用于标准环境app.yaml
文件,但这是行不通的。请注意,在大多数情况下,无效设置将被忽略,因此您需要小心。
对于标准环境,您无法明确选择单个资源,您只能使用Runtime 和 app 元素instance_class
中的选项:
实例类
可选的。此服务的实例类。
以下值可用,具体取决于您的服务的 扩展:
自动缩放
F1、F2、F4、F4_1G
默认值:如果您没有指定实例类以及automatic_scaling元素,则分配F1 。
基本和手动缩放
B1、B2、B4、B4_1G、B8
默认值:如果您没有指定实例类以及basic_scaling元素或 manual_scaling元素,则分配B2。
注意:如果instance_class设置为F2或更高,您可以通过将max_concurrent_requests设置为高于 10(默认值)的值来优化您的实例。要找到最佳值,请逐渐增加它并监控应用程序的性能。
当前支持的标准环境实例类中可用的最大内存量为 1G,如果您确实需要 6G,则必须迁移到柔性环境。
推荐阅读
- ionic-framework - 如何从谷歌地图中删除标记集群(Ionic4)
- matlab - 如何在 Matlab 中更新 scatter3 图(在循环中)
- python - 按在 linux 上创建的时间对文件名进行排序
- r - 通过组合另一个数据框中的其他两列在数据框中添加一列
- python - 如何使用 Crontab 执行 Python 自定义命令
- java - 如何在android中获取getter setter方法的值?
- ruby-on-rails - RubyZip:找不到存储在活动存储中的文件的路径
- ionic3 - 如何在 ionic 3 应用程序中为输入字段提供自定义自动完成建议列表?
- python - 如果所有列都包含特定模式,则选择 pandas 数据框中的行
- python - 获取 ManyToManyField 的条目