Mehdi Benmoha
Mehdi Benmoha

Reputation: 3935

AppEngine NodeJS flexible spawns 2 instances after deployment

I have a pretty basic app.yaml file with the following:

runtime: nodejs
env: flex
service: front

And everytime I deploy the application, the deployment take a very long time in the step:

Updating service [front] (this may take several minutes)...

When I check in the console, I can see that it goes up from 1 instances to 2 even if I didn't specify anything about the number of instances. Why is Google doing this ? and how can we set the starting number of instances without disabling the autoscaling feature ? Thanks in advance !

Upvotes: 0

Views: 46

Answers (1)

LundinCast
LundinCast

Reputation: 9810

On App Engine Flexible applications, the minimum number of instances given to your service defaults to 2 to reduce latency. This is documented here.

You can configure these settings differently by adding them in your app.yaml file like this:

runtime: nodejs
env: flex
service: front

automatic_scaling:
  min_num_instances: 1   // Default is 2. Must be 1 or greater
  max_num_instances: 10  // Default is 20.

Upvotes: 1

Related Questions