> Our Rust code runs more efficiently compared to our old Lua code. What a surprise, replacing an interpred dynamic language with a AOT compiled static language leads to performance improvements. I guess the learnings using Tcl as configuration language for Apache based proxies 20 years ago was lost in newer generations.
Pingora, the proxy that connects Cloudflare to the Internet
121–127 of 127 posts
Re: Pingora, the proxy that connects Cloudflare to the Internet
#122Earlier quoted context omitted.
Agree with you on most except for one point: > You have x types of string instead of one or two Funny how you said X, while there are really only 3 types of strings in standard library. You generally only encounter 2 of them: String and OsString. OsString, while annoying, but it's one of the things that makes rust safe. You only ever deal with 3rd type, CString, when you work with FFI, at which point you better alrea…
There is also PathBuf, which would use a string in most languages. And sometimes one may need to work with Vec or Vec . And then slice/view variants of all the above.
Re: Pingora, the proxy that connects Cloudflare to the Internet
#123> When crashes do occur an engineer needs to spend time to diagnose how it happened and what caused it. Since Pingora's inception we’ve served a few hundred trillion requests and have yet to crash due to our service code. > In fact, Pingora crashes are so rare we usually find unrelated issues when we do encounter one. Recently we discovered a kernel bug soon after our service started crashing. We've also discovered h…
I had a very similar experience. Much smaller scale, but the service was keeping internal state and clients were connecting with a WebSocket. It could handle up to a million clients on one server and it practically never crashed. While I was writing it I had only hobby-level experience with Rust and I was also mentoring a colleague, so he wrote a big chunk of code as a total Rust noob.
Re: Pingora, the proxy that connects Cloudflare to the Internet
#124Earlier quoted context omitted.
I had a very similar experience. Much smaller scale, but the service was keeping internal state and clients were connecting with a WebSocket. It could handle up to a million clients on one server and it practically never crashed. While I was writing it I had only hobby-level experience with Rust and I was also mentoring a colleague, so he wrote a big chunk of code as a total Rust noob.
I have a theory that people who are noobs in a certain technology, but are overall experienced, tend to produce very solid code, because they actively avoid doing clever things.
Re: Pingora, the proxy that connects Cloudflare to the Internet
#125What are HTTP status codes greater than 599 used for in practice? It'd be interesting to see another Cloudflare blog post that just goes into detail on the weird protocol behaviour they've had to work around over the years. I imagine they have more insight into this than pretty much any other organisation on the planet.
Re: Pingora, the proxy that connects Cloudflare to the Internet
#126Earlier quoted context omitted.
Well, rust's async ecosystem is top-notch as long as you're writing a network load balancer...
Rust's ecosystem is usually fantastic for CLI tools and specialized network servers. Large REST API servers aren't quite as solid (but perfectly doable for basic cases), and GUIs are nowhere near mature. In several major areas, I actually like the available Rust crates for a given task more than I like the available npm modules. Rust has many fewer third-party libraries available, but the quality is often good.
Re: Pingora, the proxy that connects Cloudflare to the Internet
#127Earlier quoted context omitted.
Agree with you on most except for one point: > You have x types of string instead of one or two Funny how you said X, while there are really only 3 types of strings in standard library. You generally only encounter 2 of them: String and OsString. OsString, while annoying, but it's one of the things that makes rust safe. You only ever deal with 3rd type, CString, when you work with FFI, at which point you better alrea…
There is also PathBuf, which would use a string in most languages. And sometimes one may need to work with Vec or Vec . And then slice/view variants of all the above.
I feel bad for them. I wanted to fix something in NeoVim's built-in lsp recently and lost all interest because of all the things you have to do to:
- Get parent directory for a path - Create that directory if it exists
Why was I annoyed by that? Well, different OSs use different path separators, in rust this is trivial because `Path` and `PathBuf` are target-specific.
That's not a type of string though, it's a path, the fact that it uses `OsString` underneath is irrelevant.
> Vec or Vec
There isn't really anything special to learn about it them, though? I doubt newbie encounter this while learning. Slices are the same thing, you just can't extend it, what is there to learn?