[MUSIC PLAYING]
CARTER MORGAN: Welcome to another episode
of "VM End-to-End," a show where we have a VM skeptic
and a VM enthusiast come together
to hash out all things Google Cloud VM-related.
Brian, thanks again for coming.
I'm excited for this episode.
BRIAN DORSEY: Money matters to everybody.
CARTER MORGAN: Yeah, exactly.
Last episode, we said, we're going
to have to talk about cost.
What this is going to do to my pockets?
And that's what I want to know, because before this episode,
I actually went and filled out a spreadsheet.
I listed all of my resources-- all of my machines and CPUs.
And then I went and saw how much it would cost to just put that
over in the cloud.
And--
BRIAN DORSEY: I know where this is going.
CARTER MORGAN: --I don't know if you're
going to be surprised by this.
It was way more expensive than just running it on-prem.
What's up with that?
BRIAN DORSEY: So that does happen
when you do a straight one-to-one mapping sometimes.
And I think the key thing is where Cloud usually
saves the most money is through having
high utilization of the machines you're actually
running at the time and changing what you're running over time.
So my question back to you is, how did you
decide on those machine sizes to put on the spreadsheet
and do the math out from?
CARTER MORGAN: I will be honest.
I sized it based on if I was purchasing a machine today,
I would need it to last three to five years.
So how much RAM do I need to have
for it to be still relevant three to five years from now?
How much space?
And then also, I need these machines
to be able to handle peak workloads that I might not
always be operating at.
And so I had to be able to have CPU and RAM that could
handle the worst-case scenario.
BRIAN DORSEY: So most days, they're probably
way overspecified.
And then occasionally, they're hitting their limits.
And that's--
CARTER MORGAN: Yes.
But they were cheaper than the Cloud--
you know what I mean?
They were cheaper than the Cloud VMs I was talking about.
BRIAN DORSEY: That's where the bulk of the savings-- and I
think there's some other stuff I want to hit.
But the bulk of the savings come from this pay
for what you use concept.
CARTER MORGAN: Pay for what you use.
I hear this.
I hear this all the time and I don't quite understand it.
I just interrupted and you were going to explain it.
But I just hear this phrase so much,
and so I really want to know.
I really didn't mean it.
BRIAN DORSEY: So the simplest is turn the machines off
when you're not using them.
But I think it also is a little bit confusing,
because usage is a broad term.
And we use it for actually two different concepts
in Google Cloud.
There's the pay for specific work done.
So if you're using a cloud storage bucket,
actually saving an item in the bucket or retrieving it.
And then there's this sense of reservations.
So the way most of the billing for the VM works is it
starts when you make the API call to turn it on.
And when we call to turn it off, that's when the billing stops.
So it's this reservation.
CARTER MORGAN: So when they talk down to the second,
pay for what you use, that's what
they're saying in that case.
BRIAN DORSEY: Yeah.
And we actually do bill to the second
with a 10-minute minimum.
So when you do the math out for a way overspecified machine,
it's going to sit at 5% usage or something all the time.
And all that extra is wasted.
And that's what we want to avoid to save the most money.
The other thing, though--
CARTER MORGAN: That does make a lot of sense.
BRIAN DORSEY: --that I'm going to jump on a little bit.
So when you just do the spreadsheet out,
you're only focusing on the computers.
And there's a lot more to it.
So you have people's time to set those up,
to troubleshoot them when something goes wrong,
to respond to failures that might happen.
You maybe overbuy for redundancy.
You've got to hook them up to a network.
You probably have some security boundaries you want to enforce.
Maybe you buy a load balancer.
All this extra stuff that is actually
baked into the cost at the hourly
or the per-second rate of a cloud VM.
CARTER MORGAN: Yeah.
That really does add up over time.
And that's true.
If I had to factor in people-hours
and all the rest of this, those costs in my spreadsheet
would go way up.
Something I am concerned with, though,
because it seems like a cloud VM is a different mental paradigm.
It's a shift in how we have to think about it.
So what are the hidden costs or gotchas
that come up when people are switching
from on-prem to cloud?
BRIAN DORSEY: Yeah.
And a lot of moving parts, and we're
encouraging you to turn things on and off,
and maybe run test environments, and this other stuff.
You hear stories about I've got this charge running
on some other service.
I don't know where it comes from.
That I think we've got a pretty good solution
for in Google Cloud.
So we have a concept of a project.
And all of the resources live in this project.
And so if you delete the project,
all the resources will get turned off and not charged
for in the future.
CARTER MORGAN: I want something like that for all of my--
BRIAN DORSEY: Oh my gosh.
Me too.
CARTER MORGAN: --subscriptions in life.
[LAUGHTER]
BRIAN DORSEY: That would be amazing.
There are some kind of not obvious things
that I think are worth paying for
or that you might not think to include in your estimates.
So the worth it side, I think it's worth
looking into the support options,
because there's some really highly trained, really awesome
folks on our support team who can help you out when things
get into troubleshooting mode.
So I think that's worth thinking about.
The other one that I think really
can be a surprise is network traffic.
So inbound networking is all free and part of the deal.
But you do pay for going out of the cloud, what we call egress,
of bandwidth.
And it's different depending on where it goes.
CARTER MORGAN: So different zones
might cost more, or from one zone to another zone
in another region--
BRIAN DORSEY: So crossing regions
costs a little bit of money, not as much.
And then getting out of cloud entirely--
so if you've got traffic going to the United States,
or to Asia, or Europe, there's a slightly different rate
for each.
CARTER MORGAN: It seems like there's
a lot of different moving pieces and parts.
You touched on that earlier.
How do I actually go about estimating
what it's going to cost for me, or how much of machine type 1
I'm going to need and machine type 2, different tiers
of service?
How do you go about estimating that?
BRIAN DORSEY: I have to, unfortunately, admit this
is actually hard to do, partly because there are so many
moving pieces.
And a straight-up multiply it out
in a spreadsheet is a way overestimate.
So how do we get more accurate?
One of the things we can do-- if you've
got a really good understanding of a workload,
we have an online calculator that
includes all of our discounts and all the different services.
And you can fill it all in, and you'll
get a solid estimate of what that would cost.
Unfortunately, it's difficult to get
to that level of knowledge of a system
without running the system.
And so what tends to be the most accurate
is to run a mini version of the system,
and log and monitor that, and of do a spike,
for either a shorter amount of time or with fewer machines,
just to see what is actually all of the moving pieces.
And then you can use that as a base to multiply and estimate
from.
CARTER MORGAN: That actually makes a lot of sense.
I guess one thing I'm curious about,
though-- because it makes sense that if I'm only spinning up
machines that I'm mostly utilizing,
I'm going to save money in that way.
What about if I have machines that
are running for a long time, though,
or if I'm close to utilization?
Because it seems like this is a rental type
model, where I'm renting, renting, renting,
and never really owning.
Are there any savings related to that.
BRIAN DORSEY: Absolutely.
There's a whole bunch.
And I think the main thing is--
and you're a Kubernetes guy.
Why do containers exist at all?
I think it's to try to get high utilization on the host machine
so that you get the most work.
And the container keeps each app in its own space
so you can put a lot of different things
on the same box, and run the box at 80% instead of 5%,
things like that.
So we have an extra tool in Cloud VMs where,
instead of trying to fit a lot of pieces in one box,
you can change the shape of the box.
So if you have a workload that is very RAM-intensive or very
CPU-intensive, you can change the shape of the machine
to fit your actual process.
CARTER MORGAN: I actually like that a lot.
I'll throw in a random example.
But if I was packing a backpack, it's
like, if I can change the shape of the dividers,
I can fit more in instead of trying
to find odd-shaped items to fit into the backpack.
So that's one of the benefits you get in the Cloud.
And that still lets you pay less, because again, you're
utilizing less space overall.
BRIAN DORSEY: And those shapes--
CARTER MORGAN: OK, that makes sense.
BRIAN DORSEY: Yeah.
CARTER MORGAN: That doesn't really--
well, I was going say that doesn't really
touch on the rental model, like this idea that we're
paying a lot, but we're never really owning the machine.
BRIAN DORSEY: To address that more directly, it
is always going to be a rental.
But when you're using it for a long time, it's more efficient.
And so we automatically offer what we call a sustained use
discount when that is the case.
So if you're running the same kinds of CPUs--
doesn't even need to be the same machine, the same kinds of CPUs
over time, we'll automatically give you
a discount of up to around 30%.
And then if you know--
so there's a big deal there.
And then if you know you've got that base workload
over a long period of time, you can essentially kind of reserve
that, a committed use discount to pay ahead, and get an even
bigger discount on that.
CARTER MORGAN: OK, so there's a lot of savings there.
There was another one--
I did a quick scan.
I did a quick look, and this one blew my mind.
I do not understand it at all.
They were called preemptible VMs.
Can tell me about those?
BRIAN DORSEY: Absolutely.
So if you imagine-- we were talking
about this Tetris problem, trying to fit things in.
You've got a data center-scale version of that.
And so if we can run machines in the corners, it's useful.
So but we need to stay flexible.
So we offer a machine, preemptible type
or a preemptible mode, basically, that fits in there.
So if you know that you have a workload that is either
relatively quick or that can be restarted,
you can run it there and run it at like a fifth of the cost.
CARTER MORGAN: A fifth of the cost?
BRIAN DORSEY: Like 20% of the cost.
So the only difference between a preemptible
and a regular machine is that it's guaranteed never
to last more than 24 hours.
It will stop.
And it might turn off at any moment.
So you have to be able to restart your work.
CARTER MORGAN: OK.
But for the types of workloads that would fit for,
that's a huge savings.
I guess another thing I'm really interested in
is on that model--
again, I'm used to maybe using 5%.
And now we're moving towards using 80%.
What happens if I'm not using anything
at all for a little while, or I don't actually
have any activity going on?
BRIAN DORSEY: That's even better.
So if you stop a VM, you only pay
for the disk usage and nothing for the actual CPU,
memory part of it.
So you can stop it and then turn it back on whenever you want.
And you can even do that on a schedule.
So if you know three days a month,
this machine needs to be working,
you can schedule that ahead of time.
CARTER MORGAN: Oh wow.
OK, then what about for things that I don't--
I can't predict, per se, a spike in traffic
for some sale or something that went on,
some celebrity mentioned my product.
Is there any way to handle that?
BRIAN DORSEY: So the most common pattern
there I think is groups of machines that are running
the same image that work together
and all live behind a load balancer.
So you've got traffic coming into one place,
and it gets spread across a couple of computers.
And then you get more traffic, and you add a few more
computers.
Less traffic, you turn them off.
So the managed instance group can actually
auto-scale the size of the group based on load or metrics
that you define.
CARTER MORGAN: And again, you're only
paying once those VMs startup?
BRIAN DORSEY: They're on and they exist.
CARTER MORGAN: Wow.
So to recap, because this actually seems really cool,
and it's changed the way I think about pricing and cost,
because before, I was buying for the next five years or so,
plus playing for people to manage things,
was paying for networking and all the rest of that.
And now with the cloud, it seems like you're really
renting or buying for the next five seconds or so.
What am I using right now?
OK, let me try to only pay for that.
BRIAN DORSEY: I agree 100%.
CARTER MORGAN: Does that sound like a good recap?
OK.
So then, you know what?
I kind of want to go and actually try this out.
I want to take my spreadsheet, and I want to go
and, based on the different types of work,
I want to see what discounts I can get.
Any tips or next steps that I should take?
BRIAN DORSEY: Yeah, go do that.
Start some VMs and see how they work.
But I want to let you know there's actually
a free trial and a free tier to help you do that
and experiment with Cloud.
CARTER MORGAN: A trial and a tier?
Please explain.
BRIAN DORSEY: So it's a little confusing.
They're both Ts, and like free trial, free tier.
So everyone new to Google Cloud gets a $300 coupon, basically,
to use in 90 days for any service, any part of Cloud
that they want to use it on.
And in addition to that, there's a long-running tier.
So the first little bit of usage for about 20 different products
is free, and then only after that do we charge.
And included in that is a small VM
that you can leave running as long as you want.
CARTER MORGAN: Oh wow.
That is really cool.
I'm going to have to go and check some of this out.
Brian, thank you so much for coming in.
BRIAN DORSEY: Absolutely.
CARTER MORGAN: If you're listening at home,
step number 1 is go try out the free tier or the free trial.
And anyone else, if you've been using Google Cloud for a while,
if you know about pricing and cost,
share some tips in the comment below for other folks that
maybe aren't as experienced.
I'll go through and read that.
I think that'd be really helpful.
Thanks for watching.
And thank you again, Brian.
[MUSIC PLAYING]