0

I'm trying to setup GCP autoscaling for my application (video converting service) and I'm experiencing the following problem:

Let's say the autoscaler creates 3 new instances and in the each instance I have 4 running processes of converting video. Then 2 processes in each of the first 2 instances finished and average CPU consumption of cluster decreased. So GCP autoscaler decides to kill one of the instances. But I still have running processes on all instances despite average CPU consumption decreased.

Is it possible to check if my app doesn't have running processes and ready to be terminated (using endpoint?) before instance removing?

Jason Aller
  • 139
  • 6

1 Answers1

0

In this case, instead of using only CPU usage as metric for Autoscaling policy, you can use Multiple metrics, like CPU usage plus custom Stackdriver Monitoring metrics. You can read about Autoscaling policies on this link.

Kamran
  • 1,415
  • 7
  • 16
  • The OP's query is about ensuring that running instances which are being terminated due to downscaling should complete their jobs. This is independent of the autoscaling policy. The --connection-draining option would be more useful here. – talonx Jul 10 '17 at 08:29