Search code examples
google-app-enginegoogle-compute-enginegoogle-managed-vm

Google Compute Engine keeps spawning instances, then deploy says no CPU's available


I'm just going through the node.js tutorials with a free trial account, and i'm stuck on the second one where you add a db. I add the mongodb deployment, shows up as a VM instances, fine. And my first deploy worked, but now that i'm trying to edit stuff, my deploy's keep failing.

The error i get is that I've exceeded my CPU quota. Watching the list of VM Instances under Compute Engine, i see it keeps spawning up instances, even though the app isn't being used. Guessing it just spins up 8 instances by default?

But then i guess the build system needs its own VM's, but the CPU capacity is used up, so none available to do subsequent builds?! I feel like i'm missing something...

Also, i see i can explicitly start VM's myself, so what process is creating them form me? And can i turn it off? or set a cap on number of instances it spawns?

Can i tell my project to only use 4

Also, the deploy takes forever, is that normal? Following the tutorials, so far I've only seen this command to deploy:

gcloud preview app deploy app.yaml --set-default

Is there another command that does an incremental deploy or something?


Solution

  • By using gcloud preview app deploy you're actually using Managed VMs which is an App Engine runtime which in turn runs Docker containers on Google Compute Engine, which it creates on its own. In other words, you're not using Google Compute Engine directly.

    To get rid of extra VMs, you need to delete old app versions: navigate to Compute > App Engine > Versions and delete the versions you don't want.

    See also this answer for more details and suggestions.