Live data from Hacker News

Pingora, the proxy that connects Cloudflare to the Internet

blog.cloudflare.com

121–127 of 127 posts

Re: Pingora, the proxy that connects Cloudflare to the Internet

#121
post #108

> 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.

Hi! I'm the tcl bot, you're the 27th person to ever mention tcl on HN!

Re: Pingora, the proxy that connects Cloudflare to the Internet

#122
post #101

Earlier 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.

Yeah, when Rust beginners (like me!) think "types of string" I think it's more likely to be &str (and its lifetime variants), String and Vec. I've gotten pretty far as a beginner by sticking to over-copying with just String, but eventually I think I'll have to figure out what works best for perf.

Re: Pingora, the proxy that connects Cloudflare to the Internet

#123
post #38

> 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.

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

#124
post #38

Earlier 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.

Nice one. I believe we should avoid doing unnecessary clever things deliberately and actively.

Re: Pingora, the proxy that connects Cloudflare to the Internet

#125

What 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.

I concur with custom signals, using a code >= 600 mitigates the risk that it would ever be allocated, or that you'd conflict with an existing unofficial use.

Re: Pingora, the proxy that connects Cloudflare to the Internet

#126
post #117
post #104

Earlier 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.

Oh, I know. I was just joking that async rust is heavily geared towards build some kind of L7 proxy.

Re: Pingora, the proxy that connects Cloudflare to the Internet

#127
post #101

Earlier 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.

> There is also PathBuf, which would use a string in most languages.

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?

Post reply on HN