Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 670
Paresh Behede Avatar asked Aug 30 '18 08:08

Paresh Behede


3 Answers

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.

like image 60
Quentin C Avatar answered Oct 01 '22 15:10

Quentin C


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.

like image 36
Armin_SC Avatar answered Oct 05 '22 15:10

Armin_SC


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

See also:

  • Introduction to instances for a description of the 2 instance types
  • Why do more requests go to new (dynamic) instances than to resident instance? for a bit more details
like image 34
Dan Cornilescu Avatar answered Oct 02 '22 15:10

Dan Cornilescu