问题
I have a Node.js app that provides a service which cannot be interrupted.
However the load to the app varies overtime and to save cost I would like the vm instance machine type to autoscale in function of the load (ie when over 80% CPU utilisation, scale up from 1 vCPU(3.75 GB memory, n1-standard-1) to 2vCPU(7.5 GB memory, n1-standard-2))
Is this possible?
PS: I have looked at using the container engine and kubernetes but due to how the app operates, the app cannot be replicated to multiple pods and continue working
回答1:
You can only change the machine type of a stopped instance and an instance is considered stopped only when the instance is in the TERMINATED state. It is not possible to change the machine type of a running instance.
https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance
来源:https://stackoverflow.com/questions/45037213/how-to-vertically-scale-google-cloud-instance-without-stopping-running-app