text stringlengths 0 2.29k |
|---|
**Gerhard Lazu:** We need to bring them closer to you. So when I was setting something up, I always thought about "Okay, let me put this thing in Tokyo (that was like last week), so Tim can access it faster." And we'll talk about the thing that I deployed to Tokyo a bit later. Maybe not in the recording, but anyways; w... |
So Fastly and DNS is a three milliseconds flat for me. And that's really important. That's a DNS, big CDN, lots of stuff runs through it. GitHub is 14 milliseconds. Not bad. You've seen that they've improved a couple of things in their infrastructure recently. My ISP has inconsistent routing to Fly.io. So sometimes, so... |
Now, Alan from Tenable, when they replaced Node.js with Rust, the latency per packet dropped by 50%. And that is a huge, huge thing, because that means a lot of money saved, both in terms of cost of running it, but also for the users. Again, we will link to the show notes. |
Now, this low latency - I think we're on a roll here. You shared a link with maxday from Lambda Cold Starts. 10 Lambda Cold Starts. This is updated daily, and it compares different languages, lambdas using different languages, and how do they compare. Do you want to tell us a little bit about that, since it was your po... |
**Tim McNamara:** Okay, so I'm curious as to whether or not I should tell that... So it's an interactive website that invites you to reload, and then see in real time how fast it would take for ten cold start applications written -- so it's the same application written in multiple languages. And the punchline is that R... |
**Gerhard Lazu:** Numbers? We need numbers. |
**Tim McNamara:** Actually, I don't have the numbers off the top of my head, but-- |
**Gerhard Lazu:** 15 milliseconds. |
**Tim McNamara:** \[22:08\] Whereas let's say in the worst case it's like a Java. Now we're talking, it moves from, in the Rust case, like, let's say instantaneous, or unable to be perceived; less than 15 milliseconds is kind of the limit of human perception. And comparing that to seconds for the Java case means that t... |
So there are a couple of reasons why this is the case. One is that - so let's compare Rust versus Python. So I think in the Rust case, all of the ten invocations took around about 15 milliseconds. So that's 1.5 milliseconds per function invocation, versus let's say a Python, where it's somewhere in the region of over 1... |
There are multiple reasons why this occurs. One is Rust -- so the implementation of AWS Lambda is actually an open source package, an open source thing called Firecracker. Now, Firecracker runs containers. And containers need to be downloaded from somewhere. And smaller containers are easier to deploy than larger conta... |
The other thing to note is that because the Rust Lambda function will actually finish executing before let's say the Python interpreter has actually interpreted the script, like has begun to read the Python script. So the Python interpreter let's say might take dozens of milliseconds to actually load up; in the worst c... |
So the reason why we use Lambda first is because it reduces the operational burden of service teams. We talked a little bit before that service teams choose their own stacks. They also are responsible for their own operations. It's on the team to actually make sure that they are available to support the application at ... |
Now, Lambda is -- and now we're talking about "Okay, well, we need to actually reduce..." It's actually very expensive to run AWS. I mean, people might joke it's expensive to buy from AWS, but it's also relatively expensive to actually run the thing. It's quite big. |
**Gerhard Lazu:** \[25:58\] Oh, yeah. |
**Tim McNamara:** So then the question is, if you can reduce, let's say, the cost of running the internal systems -- and in Java, if we look at that Lambda Cold Start analysis by maxday... I'm just opening up the page now. Java 11 takes 435 milliseconds; Java 8 is a 530... Whereas Rust is 15 milliseconds. And by the wa... |
**Gerhard Lazu:** So just to put this like in X numbers... Java is 29 times slower than Rust. Not 10x, 30x slower. Go is 4.3 times slower. In other words, Rust is 4.3 times faster. So in a way, you can say that Rust is to Go what Go is to Java. And that's what the numbers are saying. So if you ever wrote Java and you t... |
**Tim McNamara:** The memory case is significant, because then we can actually bundle the applications into smaller containers, which means we can pack more containers in the same host, and actually get overall savings across the entire system, or the whole fleet... Which at AWS' scale translates to, conservatively, hu... |
**Gerhard Lazu:** That's a nice one. By the way, you're saving the company, but what is not said, that you're also saving users money. Because you, running, will be paying less, regardless where you run, by the way. Even if it's not AWS, by using a language which is very nicely optimized, latency is better, memory is b... |
**Tim McNamara:** Yeah. So it turns out that developers really like programming in Rust. And one of the worst things about becoming an advocate for the Rust ecosystem is that you kind of don't stop talking about Rust. \[laughs\] |
**Gerhard Lazu:** I'll change the subject soon, but... A few more minutes, and that's it. \[laughs\] No, no, no. Please keep going, Tim. Please keep going. |
**Tim McNamara:** And there are a few reasons why this is the case. Rust as a language provides a couple of primitives for being really expressive. And it's a very consistent language. And it came late, and therefore could learn a lot of lessons from, I guess, its peer languages. |
So at this time I'd like to chat about a couple of these... One of them is some of these language features. So Rust is a programming language that kind of bolts together C++ on one side, and let's say maybe Haskell or ML on the other side. And if you know the history -- so functional languages have typically had pieces... |
**Gerhard Lazu:** \[30:31\] Yeah. I use it often. Guilty as charged. |
**Tim McNamara:** Right. It's because you know that error will never occur. |
**Gerhard Lazu:** Right. Famous last words... \[laughs\] |
**Tim McNamara:** Well, yeah, exactly. I mean, I was a Go programmer for a year and a half or so at Canonical, and we had a large application, and we had hundreds of these things. And to me, now, they just look like grenades, or just mines; at some point in the future there will be and edge case that will cause everyth... |
**Gerhard Lazu:** Minesweeper, that's what I'm thinking. Minesweeper. You never know what's gonna be behind that click... |
**Tim McNamara:** That's right. |
**Gerhard Lazu:** Okay, okay. How does Rust handle errors? |
**Tim McNamara:** Every function that can, let's say, result in an error state is modeled as an enum with a good state, or let's say an okay state, and an error state. And packed inside the okay component is what you expect to be the happy path. And inside the error state, or error side of the enum, is whatever you wan... |
I've sort of thought about Rust in terms of "Well--" So Rust was created because of this existential threat that Mozilla face from Google Chrome. Firefox needed to be faster, and it could do that with parallelism. But C++ was actually too difficult for them to fix -- actually, all they wanted to do was parallelize CSS ... |
There will be something that replaces Rust. It's not perfect. There's things that kind of irritate me. And I am particularly irritated by the fact that it's quite difficult to learn; some of its semantics are different. But irrespective of that, it's proven to be very, very practical. So if I can talk from our own expe... |
**Gerhard Lazu:** \[34:23\] When was this? Is this something recent? |
**Tim McNamara:** Amazon S3's shard store -- in terms of the timing, I think it was publicly announced in 2021... But I'm actually unfamiliar, or actually I'm not sure exactly when the project started. So actually, Rust has enabled S3 to perform better almost by definition at hyperscale, as well as -- how am I going to... |
**Gerhard Lazu:** Yeah. And the correctness, most importantly. It's more correct than it was before. |
**Tim McNamara:** I actually don't know whether or not it exceeds the other implementations of the storage node internal API, or whether or not at least it meets the very high standard, if you know what I mean. So it's very difficult to, in some sense, dethrone a service that is running very well, so Rust really needed... |
Amazon staff probably work on either Linux or macOS laptops, and there might be ARM or Intel chips, and then they deploy to Linux-based servers that, again, might be x86 or ARM architecture. And so it's quite difficult over a long period to kind of create a developer utility and make it installable. For example, with l... |
**Break:** \[36:58\] |
**Gerhard Lazu:** I know that, again, back to your AWS re:Invent talk, AWS are big believers in Rust... It's present in many places within AWS, including services that we use. I know I use one of them, Amazon Prime. I was surprised that Rust is there. But also other places, like Firecracker. I'm a big fan of the techno... |
**Tim McNamara:** Yeah, so there was a really good blog post... I say this because it's my company that wrote it. No, there was actually a genuinely good blog post called "Sustainability with Rust" that was put out by my colleagues about a year ago, at the start of February 22. And that provides a couple of glimpses at... |
**Gerhard Lazu:** Right. |
**Tim McNamara:** And the -- I mean, it's quite a long post, because we are trying to really flesh out a lot of the strengths of Rust there. But one of the things that is -- the big message is that we as a software industry, and we as AWS, as a very large consumer of electricity, can reduce our environmental impact in ... |
**Gerhard Lazu:** Yup. |
**Tim McNamara:** And I think that Rust is not the complete answer to this. But it only needs to be a partial answer. I mean, it's a programming language... But it is a good partial answer for fighting back against this problem of software bloat |
**Gerhard Lazu:** I have an important question... What kind of dollars are we talking about here? Is it New Zealand dollars, is it Australian dollars? Right? Because there's a huge difference... \[laughs\] |
**Tim McNamara:** Right, right, right. Is it Zimbabwean dollars...? |
**Gerhard Lazu:** Exactly. \[laughs\] |
**Tim McNamara:** I'm talking US dollars. |
**Gerhard Lazu:** \[41:58\] So 100 million US dollars. Okay. Okay. |
**Tim McNamara:** Yeah, that's the target that I'm setting for myself. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.