大约每周一次,我们的灵活应用引擎节点应用会脱机,日志中会出现以下行:Restarting batch of VMs for version 20181008t134234 as part of rolling restart.
我们将应用设置为自动缩放,设置如下:
runtime: nodejs
env: flex
beta_settings:
cloud_sql_instances: tuzag-v2:us-east4:tuzag-db
automatic_scaling:
min_num_instances: 1
max_num_instances: 3
liveness_check:
path: "/"
check_interval_sec: 30
timeout_sec: 4
failure_threshold: 2
success_threshold: 2
readiness_check:
path: "/"
check_interval_sec: 15
timeout_sec: 4
failure_threshold: 2
success_threshold: 2
app_start_timeout_sec: 300
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 10
我了解 GCP/GAE 的滚动重启,但我很困惑为什么 Google 在让我们的主要虚拟机离线之前不启动另一台虚拟机。我们是否必须至少运行 2 个实例才能防止这种情况发生?有没有办法让我配置我app.yaml
以确保在重启唯一运行的实例之前启动另一个实例?重启完成后,一切都恢复正常,但仍有 10 分钟的停机时间,这是不可接受的,尤其是考虑到我们无法控制它何时重启。