Hey Kevin, This is essentially how autoscaling for vanilla App Engine <https://cloud.google.com/appengine/docs/python/scaling> works. In order for it to work with VMs, you'll need to do exactly as you said, have a front-end proxy which i) accepts the user request ii) tells a VM to spin up iii) serves a waiting page to the user which will periodically check back through the proxy to see if the VM is ready iv) redirect to the VM once it's up. If an available VM exists, you won't need to spin one up and can immediately redirect the user.
This is a pretty common pattern generally, although even with Managed VMs, you can use auto-scaling with a minimum of 2 instances, which should cover pretty much any scenario. Finally, Compute Engine also has an autoscaler <https://cloud.google.com/compute/docs/autoscaler/>. Hope this was helpful! Nick Cloud Platform Community Support On Wednesday, April 13, 2016 at 2:21:40 PM UTC-4, Kevin Monagle wrote: > > Looking for a high level approach to this problem... > > Let's say I created 10 VMs. In order to minimize costs, I'd like to > observe those VMs and shut them down when no one is connected to them. This > part is easy...I can ping the machine and use the Google API to simply shut > the machine down if no one is connected. > > On the flip side, I'd like to automatically start the machine up when a > user attempts to connect. I don't want this to be a manual process. > > Users will always connect to my app on the VM via http on a particular > port. Would it be possible to put some kind of proxy in front of my 10 VMs > that would intercept incoming connections and start the target VM if it was > shut down? And then forward the connection to the target once it's running? > > Does anybody have any experience with this? Or does Google offer this > functionality in any form? > > I'm using NodeJS in my app implementation. Any feedback/ideas would be > appreciated. Thanks! > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/e0181006-5384-44f7-b09a-7cc09acf2e42%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
