I could not clearly understand why would managed instance group create new instances when the CPU uses are higher, if the starter script is taking more resources for one instance then generating one more will not resolve the issue but will aggravate it , isn’t it? and VMs are not like multithreading where multiple threads together can finish the job early by parallelization . So can you give me a real life example where using a managed instance group can be applied.
The managed instance group (MIG) can autoscale to add VMs as necessary when the workload demands it. The resources required for a single instance are kept down by the use of load balancing. MIGs work with load balancing services to distribute traffic across all of the instances in the group. Use cases include website frontends (MIGs can work across regions as well), intensive image processing, or long-running batch computations (for a stateful example).
Manage Instance Groups – deploy copies of the same VM instance template and if set to autoscale will scale to the maximum quota set. If someone misconfigured a start up script that consumed CPU resources. Then yes, that would could cause a scaling event that would eventually trigger all available instances to be running.
However, misconfigurations aside, as Joseph mentioned MIGs work great when a small web server does one thing like serve web requests. Calculating the scaling metrics for number of request might be very difficult for new application. Until you have that metric, scaling by CPU allows a path forward to keep user response high, while also keep cost lower by running fewer machines during slow periods. It provides a way to AutoScale before defined metrics are known.
Hope that helps,