2

I am using Google Instance group with Windows machines. Now the problem which I am facing is that when the load decreases Google scale down machine even though some job is running on the machine. Is there a way I can prevent machine from being scaled down or create a custom metric on the basis of number of Java process which are running and do not terminate the machine if the count is >0

Maxim
  • 4,075
  • 1
  • 14
  • 23
Amol
  • 479
  • 5
  • 18

1 Answers1

-2

You can choose to scale using the following policies [1]: - Average CPU utilization - HTTP load balancing serving capacity, which can be based on either utilization or requests per second. - Stackdriver Monitoring metrics

So a custom [3] metric is included there, you can find steps at [4].

Something else you may want to try is stopping auto scaling for your MIG [2].

Cheers,

Miguel.

[1] https://cloud.google.com/compute/docs/load-balancing-and-autoscaling#policies [2] https://cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/stop-autoscaling [3] https://cloud.google.com/monitoring/custom-metrics/ [4] https://cloud.google.com/monitoring/custom-metrics/creating-metrics

  • This doesn't really answer the question. Is there some way to tell the autoscaler to not delete an instance, or add some rule that only instances that fulfill a certain criterion can be deleted? – Illidanek Feb 11 '22 at 11:53