Paresh Behede
Paresh Behede

Reputation: 6295

What is the difference between min-instances and min-idle-instances in google app engine?

I want to understand the difference between min-instances & min-idle-instances?

I saw documentation on https://cloud.google.com/appengine/docs/standard/java/config/appref#scaling_elements but I am not able to differentiate between the two.

My use case: I want at least 1 instance always up, as otherwise in most of the cases GAE would take time in creating instance causing my requests to time out (in case of basic scaling).

It should stay up, no matter if there is traffic or not, and if a request comes it should immediately serve it. If request volume grows then it should scale.

Which one I should use?

Upvotes: 15

Views: 10580

Answers (4)

Quentin C
Quentin C

Reputation: 1893

min_instances: the minimum number of instances running at any time, traffic or no traffic, rain or shine.

min_idle_instances: the minimum of idle (or "unused") instances running over the currently used instances. Example: you automatically scaled to 5 app engine instances that are receiving requests, by setting min_idle_instances to 2, you will be running 7 instances in total, the 2 "extra" instances are idle and waiting in case you receive more load. The goal is that when load raises, your users don't have to wait the load time it takes to start up an instance.

IMPORTANT: you need to configure warmup requests for that to work

IMPORTANT2: you'll be billed for any instance running, idle or not. App engine is not cheap so be careful.

Upvotes: 7

Armin_SC
Armin_SC

Reputation: 2270

The min-idle-instances make reference to the instances that are ready to support your application in case you receive high traffic or CPU intensive tasks, unlike the min_instances which are the instances used to process the incoming request immediately. I suggest you to take a look on this link to have a deeper explanation of idle instances.

Based on this, since your use-case is focused on serve the incoming requests immediately, I think you should rather go with the min_instances functionality and use the min-idle-instances only in case you want to be ready for sudden load spikes.

Upvotes: 10

Dan Cornilescu
Dan Cornilescu

Reputation: 39834

The min-instances configuration applies to dynamic instances while min-idle-instances applies to idle/resident instances.

See also:

Upvotes: 5

Mangu
Mangu

Reputation: 3325

min_instances applies to the number of instances that you want to have running, from 0 (useful if you want to scale down when you don't receive traffic) to 1000. You are charged for the number of instances you have running, so, this is important to save costs.

For your case set this value to 1, as it's the most straightforward option.

Upvotes: 0

Related Questions