Deploying an Application to App Engine: Scaling Types for Dynamic Instance Management

Which Scaling Type Should You Use?

Question

You are deploying an application to App Engine.

You want the number of instances to scale based on request rate.

You need at least 3 unoccupied instances at all times.

Which scaling type should you use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed

The most appropriate scaling type for the given scenario is option C: Basic Scaling with max_instances set to 3.

Explanation:

App Engine provides three types of scaling options:

  1. Manual Scaling: The user manually sets the number of instances to be created and maintained. This option is not suitable for the given scenario as it does not scale based on request rate.

  2. Basic Scaling: This scaling type creates instances automatically when the application receives requests and shuts them down when they are idle. The number of instances is determined by the values of the min_instances, max_instances, and idle_timeout parameters.

Option B is not the correct choice because min_instances sets the minimum number of instances to be maintained, but it does not guarantee that there will be at least 3 unoccupied instances at all times.

Option C is the best choice because setting max_instances to 3 ensures that there will always be at least 3 instances available to handle requests, regardless of request rate. App Engine automatically creates new instances when the number of requests increases and shuts them down when they are idle.

  1. Automatic Scaling: This scaling type automatically scales the number of instances based on the application's request rate and CPU utilization. The min_idle_instances parameter can be used to set the minimum number of idle instances to be maintained.

Option D is not the correct choice because min_idle_instances only guarantees that a minimum number of idle instances will be maintained, but it does not guarantee that there will be at least 3 unoccupied instances at all times.

In summary, the best option for the given scenario is Basic Scaling with max_instances set to 3.