News for hackers. Stuff that matters.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by titzer on Wednesday October 13, 2021 @01:03AM (#28848411)
I have trouble thinking of a use case that fits this VM type. Is it for batch processing tasks that don't have tight deadlines? The lack of any real guarantees makes it hard to price, as you have no idea what you're actually paying for. Would it make sense to have a model that includes deadlines in its pricing (like give this process 2.5 hours of CPU and 4GB of RAM to complete this task by...next Tuesday)?
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by teraflop on Wednesday October 13, 2021 @01:25AM (#28848519)
That's correct: spot instances are ideal for batch workloads with relatively little persistent state. If your deadline for completing a unit of work isn't extremely short, and you're already distributing jobs across a pool of worker nodes, it's relatively straightforward to dynamically start spot instances if they're available, and on-demand instances otherwise.

Technically, you're gambling a bit because whenever a spot instance is terminated, you probably need to spend a bit extra to redo whatever work it was in the middle of. But spot instances have such a huge discount that it's almost always worth taking that risk, as long as you don't mind the extra management complexity.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by hiyer on Wednesday October 13, 2021 @02:10AM (#28848739)
> Is it for batch processing tasks that don't have tight deadlines?

I used to work for a company (since shut down) which provided big data processing systems in the cloud. This was one of the typical use-cases for our customers. Big data systems like Hadoop, Spark, etc are built to handle this kind of disruption where you lose a few nodes once in a while, and we had built in further optimizations to do it even better. This fact, combined with the much cheaper price of Spot Instances (upto 90% less than on-demand) make them a compelling alternative to on-demand instances.

In practice - at least on AWS - spot loss used to be quite rare. When it happened, it happened by the truckload, but we used to have spot instances run for several days without termination.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by khuey on Wednesday October 13, 2021 @02:20AM (#28848804)
I've had AWS spot instances run for months without termination.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by wmf on Wednesday October 13, 2021 @01:05AM (#28848425)
You might be misunderstanding how spot works. The VM either runs at full speed or not at all so you know what you're getting.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by titzer on Wednesday October 13, 2021 @01:20AM (#28848493)
Nevertheless, doesn't that force you to divide your work up into units somehow and manage external storage to track what/how much is done?
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by jiggawatts on Wednesday October 13, 2021 @01:30AM (#28848546)
Yes, but this is common for "cloud native" applications. Web servers are ideally stateless "cattle", not "pets". Code is pulled down via CI/CD pipelines or via container images. State is in databases or blobs. Logs stream to some sort of analytics system.

Similarly, Kubernetes works well with spot VMs. You can have Spot and Regular node pools in one cluster, and then your workloads can happily spread out to the extra capacity at a huge discount.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by Spivak on Wednesday October 13, 2021 @01:44PM (#28855148)
It's really easy to "beat" the chaos monkey with this kind of design. You can destroy any VMs in our infra with reckless abandon and everything will be fine. If you destroy all the VMs of particular service obviously it will affect availability but it will still recover by itself in about 60 seconds.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by wbl on Wednesday October 13, 2021 @01:33AM (#28848562)
You have to do that anyway for serious batch processing.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by pushrax on Wednesday October 13, 2021 @02:52AM (#28848997)
The reality at scale is that all cloud VMs are preemptible and unreliable. You can pay more to increase the probability of uptime but inevitably have to recover from failure sometimes.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by ClumsyPilot on Wednesday October 13, 2021 @07:37AM (#28850933)
The reality is itselt preemptible and unreliable, you could be terminated without notice
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by junon on Wednesday October 13, 2021 @04:51AM (#28849809)
This is absolutely the correct way of thinking about this problem, and exactly how most people I've seen successfully use pre-empt instances treat them as well.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by pm90 on Wednesday October 13, 2021 @04:30AM (#28849690)
There are tools that enable this (e.g. look at temporal.io).

As for external storage: yes, you do generate more metadata, but that's often a tiny fraction of the cost saved by moving to spot machines.

In general, these tools are adopted more for increasing reliability of existing systems, but I predict they would be a neat fit to run them on spot machines.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by orlovs on Wednesday October 13, 2021 @07:10AM (#28850741)
+1 for Temporal. Using in prod, its great
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by swyx on Thursday October 14, 2021 @06:35PM (#28871092)
(i work at Temporal) nice! glad you're happy with it, would love to learn more if you have any compliments/complaints, lets hear it :)
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by dagw on Wednesday October 13, 2021 @05:21AM (#28850009)
That is probably the primary use case for spot instances and certainly how I tend to used them. I have a few thousand files that need processing and each files takes 30 minutes. So I spin up 100 spot instances and use a small script to copy the file from a control machine to the next available remote machine, start the processing script, and then copy the result back when done.

I've also got another script that keeps track of how many spot instances are currently running and spins up some new ones (possibly in a different region) if they fall below a certain level.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by NavinF on Wednesday October 13, 2021 @02:29AM (#28848860)
You gotta do that anyway. It really sucks when a multi-day job crashes halfway through because of some silly bug and then you gotta restart from the beginning. The ability to resume from crashes is required regardless of where you're running the code.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by roca on Wednesday October 13, 2021 @01:26AM (#28848527)
All our pernos.co infrastructure uses AWS spot VMs. Batch processing runs on spot and fails over to regular VMs as necessary. CI jobs run on spot. Our front-end server running the Web site and our application also runs on spot and automatically fails over to a regular VM if it gets terminated. Termination is rare.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by technics256 on Wednesday October 13, 2021 @08:08AM (#28851125)
How do you coordinate the failover? Custom scripts or?
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by roca on Thursday October 14, 2021 @05:56PM (#28870719)
We use custom logic. There are various ways to do it. One way to do it is to poll for the termination signal on the running instance, as part of your app say, and if you see termination coming, trigger a Lambda that supervises the bringup of an on-demand instance. For critical stuff you probably want a backup system that checks instance health and brings up a new instance if the old one is not available ... but you probably want that even if you always run on-demand.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by zamalek on Wednesday October 13, 2021 @01:08AM (#28848441)
If your code can survive chaos monkey, it can trivially weather this. Netflix, as one example, could run their entire infrastructure on these VMs.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by forty on Wednesday October 13, 2021 @01:19AM (#28848488)
Well except that on peak hours their infrastructure would disappear :)

You always need some traditional instances to serve things that need to be available at all time, like your website. Now you could run things using spot instances and switch to traditional during peak hours but that requires confidence that enough capacity is going to be available when you need it (which is going to be at the same time as everyone else, so it's always a bet :))

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by cma on Wednesday October 13, 2021 @01:54AM (#28848660)
Apparently some just gamble that by having some instances of every time, they won't all go down:

"However, your cloud provider can pull these virtual machines out from under you at any time without notice (because someone else is willing to pay more). So how do you lower the probability of losing all of your instances to nearly zero? Cloud providers generally need to have a large buffer of capacity and they have many different virtual machine configurations with different CPU and memory sizes. So, don’t just spin up virtual machines of a single configuration type, spin up lots of them from many different configuration types!"

https://blog.comma.ai/scaling-for-10x-user-growth/

I'm not sure if they still have a fallback of traditional instances.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by forty on Wednesday October 13, 2021 @02:45PM (#28855813)
Yes absolutely. On AWS you can use spot instance fleets to implement this strategy https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot...
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by snewman on Wednesday October 13, 2021 @01:19AM (#28848484)
Except that (presumably) there is no guarantee that any spot instances are available. You could wind up in a state where you have no instances running. No user-facing production service can tolerate that.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by roland35 on Wednesday October 13, 2021 @12:09PM (#28854034)
I believe AWS can create spot autoscaling groups which include a minimum baseline traditional instances plus a floating level of spot instances. This seems to be a nice compromise.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by roca on Wednesday October 13, 2021 @01:27AM (#28848535)
Just spin up regular VMs if you can't get spot instances when you need them.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by xyzzyz on Wednesday October 13, 2021 @02:28AM (#28848849)
Lack of spot VM means that all spare capacity has been taken up by the regular VMs, meaning that it spots are gone, so are regular ones.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by apendleton on Wednesday October 13, 2021 @03:57AM (#28849498)
Having worked on infrastructure deployed this way, I can say this oversimplifies a bit. There's virtually never no spot capacity at all, there's no capacity at a given bid price, for a given instance type, in a given region. You can start to scale up on-demand infrastructure using spot price as a signal, before there's literally none left, and you can also run on clusters of heterogeneous instances, and change your instance type mix when one instance type's price goes up. In the worst case you can fail out of a particular region whose spot prices have gotten too high. Lots of options.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by sitkack on Wednesday October 13, 2021 @06:10AM (#28850325)
No shade, but this is a very AWS specific view of cloud. Every cloud has a different resource allocation philosophy, not all the assumptions are the same.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by remram on Wednesday October 13, 2021 @11:33AM (#28853487)
Yeah, GCP spot instances don't vary in price like AWS ("The price adjustments will occur at most once a month").
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by ianburrell on Wednesday October 13, 2021 @12:54PM (#28854560)
There is no longer bidding for spot prices on AWS. They moved to model where pay the fixed spot price which isn't based on capacity.

https://aws.amazon.com/blogs/compute/new-amazon-ec2-spot-pri...

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by remram on Thursday October 14, 2021 @12:28AM (#28860524)
Interesting! I think it still updates more than once a month, but that is a significant change that I wasn't aware of, thank you.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by roca on Thursday October 14, 2021 @05:57PM (#28870728)
Maybe that's true but we haven't seen this happen in practice. Maybe we're just incredibly lucky but we're able to get on-demand instances to recover after spot termination.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by jayd16 on Wednesday October 13, 2021 @03:06AM (#28849087)
No guarantee but still very likely there are instances available.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by jpdb on Wednesday October 13, 2021 @08:34AM (#28851322)
Spot is excess capacity. If there's zero excess capacity, that means there's (probably) also no on-demand capacity as well.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by remram on Wednesday October 13, 2021 @11:35AM (#28853504)
If you are not being given any excess capacity, that doesn't mean there is no excess capacity. You are just not one of the lucky few, whose numbers are shrinking.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by toast0 on Wednesday October 13, 2021 @01:36AM (#28848574)
The 30 second shutdown warning makes this a bit tricky for interactive work, but if your interactive requests will all finish within 20 seconds or so (or you can hand them off), and 5 seconds to get out of load balancing, this could be cost savings for whatever fits; some base number of nodes + a number of spot nodes as demand requires, if no spot nodes are available, serve from somewhat overloaded base nodes + maybe some regular priced nodes (but fewer extra nodes than at spot prices).

Or, more likely, for batch processing that's mostly time insensitive. Things that can be resumed without losing much work or lots of small short jobs. Retranscoding media with new settings comes to mind. If you've got deadlines, you'd probably need a mix of on-demand and spot nodes.

This is the corner of cloud pricing where if you can optimize use of this, you might be able to do better than traditional hosting. But only if your needs are variable, or you get a lot of high discount spot pricing.

Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by whazor on Wednesday October 13, 2021 @01:20AM (#28848494)
With Spark you can indeed run batch jobs on multiple VMs. We are currently working having dynamic allocation and preemption on Kubernetes. This is for us essential for our on premise cluster, as we want fair sharing. But for our cloud GCP jobs we could indeed save money by having a pool of spot instances. If deadlines are important, you could replace them by normal instances.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by bubblethink on Wednesday October 13, 2021 @02:33AM (#28848885)
They are also great if you are paying out of your own pocket and not your employer's. For side projects, academic work, etc., that need GPU instances or large memory instances, the regular pricing is quite out of whack. Spot pricing makes it tolerable.
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by Thristle on Wednesday October 13, 2021 @07:47AM (#28850989)
1. You only pay for compute time you actaully get 2. Any stateless process such as web servers are ideal for spots 3. Also k8s nodes are very good to run in spot since pods are "natively" crash "resistant"
Re:GCP releases Spot VMs, the next generation of Pre-emptibl... by ramoz on Wednesday October 13, 2021 @04:06AM (#28849562)
My team runs fairly large GKE clusters on preemptible machines, and with a dedicated footprint that can scale if needed. Business critical workloads, we ensure a lot of these https://cloud.google.com/kubernetes-engine/docs/concepts/spo...

cost savings.