0
votes

Google app engine creates a new version for every deployment and it starts serving through the new version by stopping the older versions (after gradually migrating all traffic to new version).But sometimes due to high load, traffic splits to the older version which starts serving. How to customise the GAE configuration or app.yaml so that all the traffic should only point to the latest one version whatever may be the load.

app.yaml

service: service-name
runtime: java
env: flex

runtime_config:
  jdk: openjdk8

handlers:
  - url: /.*
    script: this field is required, but ignored

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 2

network:
  instance_tag: test
  name: dev
  subnetwork_name: dev-1
  session_affinity: true
1

1 Answers

0
votes

Actually, your application is already doing that, since you did not added the warmup configuration to your app.yaml, as you can see on this documentation.

However, your instance will still have it's limits and when they are reached the load balancer will look for an instance that is available to process requests, which will likely be the older instance that is still up.

So, the solution for your problem is to check and change the load balancer configuration for your instances, however, as you can see on this community post, this will only be possible if you are using App Engine Flexible, because on App Engine Standard this is managed by Google Cloud and you cannot configure it.

If you are using App Engine Flexible, you can check this documentation for how to add an instance group to a load balancer and also how to choose a load balancer that best suit your app's needs.

Hope this helps.