News for hackers. Stuff that matters.
Re:AWS vs. GCP reliability is wildly different by rwiggins on Wednesday September 21, 2022 @07:37PM (#32933067)
There were 84 errors for GCP, but the breakdown says 74 409s and 5 timeouts. Maybe it was 79 409s? Or 10 timeouts?

I suspect the 409 conflicts are probably from the instance name not being unique in the test. It looks like the instance name used was:

    instance_name = f"gpu-test-{int(time())}"
which has a 1-second precision. The test harness appears to do a `sleep(1)` between test creations, but this sort of thing can have weird boundary cases, particularly because (1) it does cleanup after creation, which will have variable latency, (2) `int()` will truncate the fractional part of the second from `time()`, and (3) `time.time()` is not monotonic.

I would not ask the author to spend money to test it again, but I think the 409s would probably disappear if you replaced `int(time())` with `uuid.uuid4()`.

Disclosure: I work at Google - on Google Compute Engine. :-)

Re:AWS vs. GCP reliability is wildly different by jrumbut on Thursday September 22, 2022 @01:00AM (#32934950)
> (3) `time.time()` is not monotonic.

I just winced in pain thinking of the ways that can bite you. I guess in a cloud/virtualized environment with many short lived instances it isn't even that obscure an issue to run into.

A nice discussion on Stack Overflow:

https://stackoverflow.com/questions/64497035/is-time-from-ti...

Re:AWS vs. GCP reliability is wildly different by flutas on Thursday September 22, 2022 @09:22AM (#32938423)
> I just winced in pain thinking of the ways that can bite you.

Something similar caused my favorite bug so far to track down.

We were seeing odd spikes in our video playback analytics of some devices watching multiple years worth of video in < 1 hour.

System.currenTimeMillis() in Java isn't monotonic either is my short answer for what was causing it. Tracking down _what_ was causing it was even more fun though. Devices (phones) were updating their system time from the network and jumping between timezones.

Re:AWS vs. GCP reliability is wildly different by jrumbut on Thursday September 22, 2022 @06:31PM (#32945469)
That's a bad day at the office when you have to go and say "hey remember all that data we painstakingly collected and maybe even billed clients for?"
Re:AWS vs. GCP reliability is wildly different by flutas on Saturday September 24, 2022 @10:35AM (#32962972)
Luckily I worked for the company that made the analytics tools and consumed them!

Bosses actually came to us because our analytics team was trying to figure out who was causing it, because it had been caught by the team doing checks against the data. (a playback period should never have had > 30s of time)

Re:AWS vs. GCP reliability is wildly different by rkangel on Thursday September 22, 2022 @07:24AM (#32937410)
Yes. When people write `time.time()` they almost always actually want `time.monotonic()`.
Re:AWS vs. GCP reliability is wildly different by hansvm on Sunday September 25, 2022 @10:40AM (#32971756)
A lot of the places you use time.time and would be bitten by non-monotonicity you probably want something like time.perf_counter, which is useless for measuring absolute time but perfect for calculating time elapsed.
Re:AWS vs. GCP reliability is wildly different by sitharus on Wednesday September 21, 2022 @07:49PM (#32933157)
This is a very good point - AWS uses tags to give instances a friendly name, so the name does not have to be unique. The same logic would not fail on AWS.
Re:AWS vs. GCP reliability is wildly different by smashed on Thursday September 22, 2022 @12:29AM (#32934804)
Which makes 2000% sense.

Why would any tenant supplied data affect anything whatsoever?

As a tenant, unless you are clashing with another resource under your own name, I don't see the point of failing.

aws S3 would be an exception, where they make that limitation on globally unique bucket name very clear.

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @01:28AM (#32935089)
Idempotency.

You're inserting a VM with a specific name. If you try to create the same resource twice, the GCE control plane reports that as a conflict.

What they're doing here would be roughly equivalent to supplying the time to the AWS RunInstances API as an idempotency token.

(I work on GCE, and asked an industry friend at AWS about how they guarantee idempotency for RunInstances).

Re:AWS vs. GCP reliability is wildly different by stevenguh on Thursday September 22, 2022 @02:04AM (#32935240)
GCP control plane is generally not idempotent.

When trying to create the same resource twice, all request should report the same status instead one failing, one succeeding.

In AWS, their APIs allow you to supply a client token if the API is not idempotent by default.

See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_I....

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @02:23AM (#32935354)
> When try to create the same resource twice, the second should report success instead of failing.

Before I quibble with the idempotency point: I agree with this, entirely, but it is what it is and a lot of software has been written against the current behavior. So I'll cite Hyrum's law here: https://www.hyrumslaw.com/

> GCP control plane is generally not idempotent.

The GCE API occupies an odd space here, imo. The resource being created is, in practice, an operation to cause the named VM to exist. The operation has its own name, but the name of the VM in the insert operation is the name of the ultimate resource.

Net, the API is idempotent at a macro level in terms of the end-to-end creation or deletion of uniquely named resources. Which is a long winded way of saying that you're right, but that from a practical perspective it accomplishes enough of the goals of a truly idempotent API to be _useful_ for avoiding the same things that the AWS mechanism avoids: creation of unexpected duplicate VMs.

The more "modern" way to do this would be to have a truly idempotent description of the target state of the actual resource with a separate resource for the current live state, but we live with the sum of our past choices.

Re:AWS vs. GCP reliability is wildly different by Terretta on Thursday September 22, 2022 @06:45AM (#32937123)
It's a lot shorter to write:

You're right, we did it wrong.

// And paradoxically makes engineers like you.

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @11:04AM (#32939851)
Sure, except I think that at a macro level we got it more right than AWS, despite some choices that I believe we'd make differently today.
Re:AWS vs. GCP reliability is wildly different by akramer on Thursday September 22, 2022 @11:24AM (#32940178)
The GCE API can be idempotent if you'd like. Fill out the requestId field with the same UUID in multiple instances.insert calls (or other mutation calls) and you will receive the same operation Id back in response.

Disclaimer: I work on GCE.

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @01:28PM (#32942029)
Today I learned! I'll admit I didn't know this functionality existed, and I've instead had used instances.insert following by querying the VM resource.

This is nicer!

Re:AWS vs. GCP reliability is wildly different by bushbaba on Thursday September 22, 2022 @01:34AM (#32935115)
Do you really need idempotency for runVM though.
Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @02:09AM (#32935272)
I mean, it's kinda nice to know that if you reissue a request for an instance that could costs thousands of dollars per month due to a network glitch that you won't accidentally create two of them?

More practically, though, the instance name here is literally the name of the instance as it appears in the RESTful URL used for future queries about it. The 409 here is rejecting an attempt to create the same explicitly named resource twice.

Re:AWS vs. GCP reliability is wildly different by philliphaydon on Thursday September 22, 2022 @06:57AM (#32937203)
Sounds like AWS got it right.
Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @11:01AM (#32939796)
You're entitled to that takeaway, but I disagree. I believe GCP's tendency to use caller-supplied names for resources is one of the single best features of the platform, particularly when compared against AWS's random hex identifiers.

Note that whether this creates collisions is entirely under the customer's control. There's no requirement for global uniqueness, just a requirement that you not try to create two VMs with the same name in the same project in the same zone.

Re:AWS vs. GCP reliability is wildly different by philliphaydon on Thursday September 22, 2022 @12:21PM (#32941101)
With GCE can you create 10 instances or do you need to create all 10 individually?
Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @01:19PM (#32941895)
As far as I know, the `instances.insert` API only allows individual VMs, although the CLI can issue a bulk set of API calls[0], and MIGs (see below) allow you to request many identical VMs with a single API call if that's for some reason important.

You can also batch API calls[1], which also gives you a response for each VM in the batch while allowing for a single HTTP request/response.

That said, if you want to create a set of effectively identical VMs all matching a template (i.e., cattle not pets), though, or you want to issue a single API call, we'd generally point you to managed instance groups[2] (which can be manually or automatically scaled up or down) wherein you supply an instance template and an instance count. The MIG is named (like nearly all GCP resources), as are the instances, with a name derived from the MIG name. After creation you can also have the group abandon the instances and then delete the group if you really wanted a bunch of unmanaged VMs created through a single API call, although I'll admit I can't think of a use-case for this (the abandon API is generally intended for pulling VMs out of a group for debugging purposes or similar).

For cases where for whatever reason you don't want a MIG (e.g., because your VMs don't share a common template). You can still group those together for monitoring purposes[3], although it's an after-creation operation.

The MIG approach sets a _goal_ for the instance count and will attempt to achieve (and maintain) that goal even in the face of limited machine stock, hardware failures, etc. The top-level API will reject (stock-out) in the event that we're out of capacity, or in the batch/bulk case will start rejecting once we run out of capacity. I don't know how AWS's RunInstances behaves if it can only partially fulfill a request in a given zone.

[0]: https://cloud.google.com/compute/docs/instances/multiple/cre...

[1]: https://cloud.google.com/compute/docs/api/how-tos/batch

[2]: https://cloud.google.com/compute/docs/instance-groups

[3]: https://cloud.google.com/compute/docs/instance-groups/creati...

Re:AWS vs. GCP reliability is wildly different by vineyardmike on Friday September 23, 2022 @04:23AM (#32949317)
> unless you are clashing with another resource under your own name, I don't see the point of failing.

Is that not the conclusion? The tester was clashing with their own names?

Re:AWS vs. GCP reliability is wildly different by mempko on Wednesday September 21, 2022 @07:56PM (#32933204)
What are your thoughts on the generally slower launch times with a huge variance on GCP?
Re:AWS vs. GCP reliability is wildly different by Crash0v3rid3 on Wednesday September 21, 2022 @08:16PM (#32933339)
The author failed to mention which regions these tests were run. GPU availability can vary depending on the regions that were tested for both Cloud providers.
Re:AWS vs. GCP reliability is wildly different by ayewo on Thursday September 22, 2022 @07:02AM (#32937236)
The author linked to the code at the end of the post.

The regions used are "us-east-1" for AWS [1] and "us-central1-b" for GCP [2].

1: https://github.com/piercefreeman/cloud-gpu-reliability/blob/...

2: https://github.com/piercefreeman/cloud-gpu-reliability/blob/...

Re:AWS vs. GCP reliability is wildly different by fomine3 on Thursday September 22, 2022 @02:42AM (#32935499)
This is a big missed point.
Re:AWS vs. GCP reliability is wildly different by jhugo on Wednesday September 21, 2022 @10:43PM (#32934270)
At work we run some (non-GPU) instances in every AWS region, and there's pretty big variability over time and region for on-demand launch time. I'd expect it might be even higher for GPU instances. I suspect that a more rigorous investigation might find there isn't quite as big a difference overall as this article suggests.
Re:AWS vs. GCP reliability is wildly different by valleyjo on Wednesday September 21, 2022 @10:21PM (#32934148)
Just remember this is for GPU instances. Other vm families are pretty fast to launch.
Re:AWS vs. GCP reliability is wildly different by kevincox on Thursday September 22, 2022 @10:12AM (#32939008)
FWIW in our use case of non-GPU instances they launched way faster and more consistently on GCP than AWS. So I guess it is complicated and may depend on exactly what instance you are launching.
Re:AWS vs. GCP reliability is wildly different by brianpan on Thursday September 22, 2022 @12:10AM (#32934705)
Time is difficult.

Reminds of me this post on mtime which recently resurfaced on HN: https://apenwarr.ca/log/20181113

Re:AWS vs. GCP reliability is wildly different by Cthulhu_ on Thursday September 22, 2022 @10:18AM (#32939096)
I've naively used millisecond precision things for a long time - not in anything critical I don't think - but I've only recently come to more of an awareness that a millisecond is a pretty long time. Recent example is that I used a timestamp to version a record in a database, but it's feasible that in a Go application, a record could feasilby be mutated multiple times a millisecond by different users / processes / requests.

Unfortunately, millisecond-precise timestamps proved to be a bit tricky in combination with sqlite.

Re:AWS vs. GCP reliability is wildly different by account42 on Friday September 23, 2022 @08:42AM (#32951108)
To put this into perspective, a game (or anything) running at 60 FPS only as a bit over 16 milliseconds to render each frame. These days higher frame rates are common enough, often putting you down into single-digit milliseconds per frame. Not think about how many things there are simulated and rendered in each frame for common games. Way more than 16.
Re:AWS vs. GCP reliability is wildly different by okdood64 on Wednesday September 21, 2022 @08:48PM (#32933554)
Hope icyfox can try running this with a fix.