Live data from Hacker News

Pingora, the proxy that connects Cloudflare to the Internet

blog.cloudflare.com

111–120 of 127 posts

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

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

> And then slice/view variants of all the above.

So all in all, about a dozen kinds of strings.

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

#112
post #44

I'm mildly blown away to read, 'And the NGINX community is not very active, and development tends to be “behind closed doors”.' Is this a reflection of the company, nginx (now owned by F5) going the way of an Oracle-style takeover of WebLogic from another era?

IMHO nginx has never been a particularly "open" or friendly open source project. I don't mean to sound rude. I don't think open source contributors "owe" anyone anything in this regard. If you want to throw code over a wall and run away, that's your prerogative. However I do think Cloudflare's assessment is accurate and a real liability for them. Some of the OSS papercuts with nginx: - nginx has always used a "submit…

> - They use Trac?! I loved Trac circa 2008 but had no idea it was still a thing. I can't even login to it without it timing out.

Oh wow! I totally forgot about Trac. That was the first ticket management software I used and I completely forgot about it's existence. Thanks for the impromptu trip down memory lane.

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

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

Curses! now I need to learn yet another language!

Libcurses in rust, what a perfect idea!

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

#114

Earlier quoted context omitted.

Wow ... 100 Gbit/s. Where do you work? That’s some serious traffic.

A german company building an app for watching linear TV. Netflix is actually serving 400Gbit/s per node and already have 800Gbit/s ready. I think we can scale our setup up to 200 Gbit/s but we are too small. Total traffic is ~2 Tbit/s. Most challenging is the missing support of QUIC/http3 and KTLS in Golang. Also 100G NIC supply chain is difficult. We use NVIDIA Connect-X 6, but it's impossible to get a version with…

There is quic-go[1] but i don't think that it's sufficiently optimized[2-4] to be used for this kind of workload. caddy will use it to provide HTTP/3 by default[5] in the upcoming 2.6.0 release.

[1]: https://github.com/lucas-clemente/quic-go [2]: https://github.com/lucas-clemente/quic-go/issues/2877 [3]: https://github.com/lucas-clemente/quic-go/issues/2607 [4]: https://github.com/lucas-clemente/quic-go/issues/341 [5]: https://github.com/caddyserver/caddy/pull/4707

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

#115
post #101
post #95

Earlier quoted context omitted.

I think ultimately the big thing Rust brings to the table is that a lot of Rust's features is geared towards detecting problems as early as possible. This means you get complexity, especially on the "initial phases". * The initial learning curve is steeper than usual . You have x types of string instead of one or two, you have lifetimes, etc, etc. Fortunately you pay it once and then can use it many times (maybe with…

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…

I said X because people include some and not others, and the conversation rapidly deviates (as shown on this thread). The point remains that there’s more ways to skin that particular cat in Rust than in other languages.

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

#116
post #52
post #34

Earlier quoted context omitted.

100 Gbit/s is only like 3000 concurrent viewers at 5000 KiB/s.

“Only” :)

Some sport events are live streamed by 10-20 million people in a single country. that means you need 3000-7000 such nodes to serve them.

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

#117
post #104

Earlier quoted context omitted.

Not from Cloudflare, but at a guess: * They already have some pretty deep Rust experience on staff * They were already dissatisfied with the performance penalty from Lua's GC, so Go's GC was presumably unattractive as well * Rust is worth more internet points than Go (just kidding, mostly)

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

#118

Earlier quoted context omitted.

Which aspect(s) of Rust do you think are most responsible for this? (e.g. borrow checker, memory safety, culture that attracts devs who care about reliability, etc)

A few things: - I think memory safety is a baseline. You'll note that memory safe languages already tend to be much more reliable than non-memory-safe languages in general. - Then you have the error handling. A lot of unreliability in my code in other languages comes from unhandled exceptions that only occur rarely. Rust generally puts all possible error conditions in the type signature of the function. Meaning it's…

Thanks for taking the time to write it down, appreciate it.

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

#119
post #41

Was Go considered as the language to write Pingora in? If so, why was Rust chosen?

Right now the idiomatic Go approach to handle networking is 2-goroutine per socket (one for reading and the other for writing). Goroutines are very lightweight userspace threads, but they're not free: each costs you a small amount of memory. At Cloudflare's scale, this overhead quickly adds up. So resource-wise, Go isn't ideal for very large scale use cases.

There is a more-than-6-year-old proposal to introduce non-blocking I/O API (https://github.com/golang/go/issues/15735) but so far it's not gaining much traction. Maybe in Go2.

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

#120
post #116
post #52

Earlier quoted context omitted.

“Only” :)

Some sport events are live streamed by 10-20 million people in a single country. that means you need 3000-7000 such nodes to serve them.

It's almost as if on-demand video streaming isnt suitable for broadcasting live events.
Post reply on HN