如何更改App Engine中的最大和最小延迟?

时间:2018-08-21 03:38:35

标签: php google-app-engine request autoscaling latency

我有一个使用PHP在App Engine上运行的项目,它是not autoscaling

我的app.yaml文件:

runtime: php
api_version: '1.0'
env: flexible
threadsafe: true
env_variables:
  APP_KEY: 'base64:*****'
  APP_LOG: errorlog
  CACHE_DRIVER: database
  DB_DATABASE: animes
  DB_HOST: localhost
  DB_PASSWORD: ******
  DB_SOCKET: '/cloudsql/*******'
  DB_USERNAME: root
  SESSION_DRIVER: database
  STORAGE_DIR: /tmp
automatic_scaling:
  min_num_instances: 2
  max_num_instances: 20
  cpu_utilization:
    target_utilization: 0.5

我需要具有延迟或请求计数的自动缩放功能吗?有可能吗?

我尝试在我的app.yaml中设置max_pending_latency和min_pending_latency,但是出现此错误:

automatic_scaling:
  max_pending_latency: 30ms
  min_pending_latency: 15ms
  min_num_instances: 1
  max_num_instances: 20
  cool_down_period_sec: 120
  cpu_utilization:
    target_utilization: 0.5

返回gcloud应用部署

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: VM-based automatic scaling should NOT 
have the following parameter(s): [min_pending_latency, max_pending_latency]
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: 'VM-based automatic scaling should NOT have the following parameter(s):
      [min_pending_latency, max_pending_latency]'
    field: version.automatic_scaling

1 个答案:

答案 0 :(得分:0)

您可以在app.yaml中看到App Engine Flex没有使用最大/最小延迟来进行扩展;所有扩展决定都是基于CPU使用率。