【问题标题】:VM-based automatic scaling should NOT have the following parameter. standard_scheduler_settings.max_instances基于 VM 的自动缩放不应具有以下参数。 standard_scheduler_settings.max_instances
【发布时间】:2022-02-22 22:40:19
【问题描述】:

在让我的项目在 GCloud 中开启 7 天后,我决定寻找一个解释。我发现 app.yaml 没有配置,因此它使用了基本的最低规范。所以我找到了这个solution
我正在尝试使用 gcloud app deploy 将 asp .net 核心应用程序部署到 GAE 中,但我正面临这个问题!我在这里做错了什么,因为我认为我遵循谷歌文档中的正确语法 https://cloud.google.com/appengine/docs/flexible/dotnet/reference/app-yaml

app.yaml

runtime: aspnetcore
env: flex
automatic_scaling:
  min_num_instances: 0
  max_num_instances: 1
  cool_down_period_sec: 180
  cpu_utilization:
    target_utilization: 0.6
  target_concurrent_requests: 100
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

我从Pricing of Google App Engine Flexible env, a $500 lesson 尝试了这个版本,但我设法让它在第一次尝试时工作,但在部署之后我一直收到上面相同的错误。

首次运行的版本

runtime: aspnetcore
env: flex
instance_class: F1
automatic_scaling:
  max_instances: 1
  min_instances: 0
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

【问题讨论】:

  • 您是说您发布的错误来自您的 app.yaml 的值,其中您有参数 - max_num_instances?我问是因为您的错误消息涉及max_instances,但您在当前app.yaml 文件中发布的内容中没有。此外,如果您想减少收到的巨额账单,我很好奇您为什么要运行多达 15 个实例
  • 啊,我的错,让我纠正一下
  • @NoCommandLine 无论我使用什么语法 max_instancesmax_num_instances 错误都是一样的

标签: asp.net-core google-app-engine google-cloud-platform


【解决方案1】:

问题是由min_num_instances 引起的,因为在Flex 环境中不能有零实例,如documentation 中所述:

标准环境可以从零个实例扩展到数千个实例 很快。相比之下,柔性环境必须至少有 每个活动版本运行一个实例

将参数的值更改为大于零应该有助于修复错误

【讨论】:

    【解决方案2】:

    这个配置最终似乎可以工作,我发现我无法将min_num_instances 设置为 0

    runtime: aspnetcore
    env: flex
    instance_class: F1
    automatic_scaling:
      min_num_instances: 1
      max_num_instances: 1
      cool_down_period_sec: 180
      cpu_utilization:
        target_utilization: 0.6
      target_concurrent_requests: 100
    inbound_services:
    - warmup
    resources:
      cpu: 1
      memory_gb: 0.5
      disk_size_gb: 10
    

    【讨论】:

      猜你喜欢
      • 2021-11-05
      • 2019-09-25
      • 2018-11-02
      • 1970-01-01
      • 2021-04-28
      • 2019-05-23
      • 2019-10-21
      • 2015-12-14
      • 2012-11-16
      相关资源
      最近更新 更多