Google Cloud today launched its Suspend/Resume feature for virtual machines into general availability. Before it launched this feature as an alpha a couple of years ago, the only option developers had were to stop and start instances. With Suspend/Resume, the experience is more akin to closing and opening the lid on your laptop, Google argues.
While the instance is suspended, you don’t pay for the cores and RAM it would typically use. Instead, you only pay for the storage cost of the instance memory. OS licensing may also be reduced, Google noted.
Other clouds offer similar features, though Google argues that because it sends a standard ACPI S3 signal — that’s the same signal your operating system sends to your desktop or laptop to put it into its sleep state and suspend to RAM — its solution is compatible with a wider range of OS images. Indeed, it encourages developers to try it out with undocumented custom OS images, since they may just work out of the box, too.
Google also argues that its solution is different because storage for the image is dynamically provisioned when a VM is suspended and independent of the boot disk. This means you don’t have to worry about running out of space on the boot disk and the suspended instance consumes less storage. While it is suspended, the instance’s IP address remains in place and once the instance is resumed, the memory is simply moved back from storage to the instance memory and the cycle continues.
You can only suspend an image for up to 60 days, though. After that, it’s automatically terminated. It’s worth noting that Suspend/Resume also doesn’t work for GPU instances, instances with more than 120 GB of memory, E2 instances and Confidential VMs. Preemptible instances can be suspended, but there is a risk that they will be terminated during the suspension process.
But the advantage here is not just cost savings. A system like this also means you can keep a few instances on standby for quick horizontal scaling when needed. Provisioning a new VM can take a while, after all. If that’s your use case, going serverless may be the way to go in the future, but that’s a long-term project while a system like this can help in the meantime.
Some companies are also using Suspend/Resume for their developer environments, which often don’t need to run 24/7. “Utilizing Compute Engine’s suspend and resume functionality has allowed BigCommerce to reduce operating costs of our Compute Engine-driven development environment,” explained Aaron Humerickhouse, Manager, Engineering at BigCommerce. “BigCommerce allows each engineer to customize their environment’s ‘working hours,’ which triggers suspension at the end of each work day and resumption at the beginning of the next day. This has reduced our Virtual Machine Instance usage times from 168 hours a week to 60 hours a week per environment on average, enabling us to save thousands of dollars each month. We expect these cost-efficiency savings to only increase as our Engineering organization grows.”