Live data from Hacker News

Pingora, the proxy that connects Cloudflare to the Internet

blog.cloudflare.com

51–60 of 127 posts

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

#51

Does anyone know why nginx used separate processes for workers, instead of threads? This post makes it sound like threads are the way to go, but presumably nginx had a reason for using processes back in the day.

Nginx was written in C. Multithreaded code in a language that doesn't provide any safety rails is hard to get right, and so is async code. They probably figured that the complexity of doing both async and multithreading outweighed the benefits that were predicted to be small. Rust's type system checks for and prohibits many kinds of mistakes that are possible in multithreaded code and in async code, so it's much easier to combine them safely.

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

#53
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!

Luckily Rust is also fun :)

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

#54

Earlier quoted context omitted.

When is night on the internet?

Most—maybe damn near all—sites see significant dips in traffic for at least a few hours a day. Which part of the day, depends on the site. More often than not, it's while the team is asleep and staffing, if any, is at its lowest point, since teams tend to live roughly in the same ~half of the world that their products are most-used in. Plus there's practically no-one in the Pacific until you reach Japan, and not a to…

Fraud prevention or even straight up order blocking between 1:30 & 4AM because the downstream order management system has only so much buffer capacity

(it's getting rarer, but it does still happen. Fraud prevention cranked up is definitely a thing on any large enough ecommerce website)

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

#56
post #5

I share lots of feelings towards NGINX that Cloudflare mention on this blog post. New features like 103 Early Hints and HTTP/3 exist in HAProxy and Caddy but there is nothing coming in NGINX.

nginx was good for a decade or two. they were acquired and doomed to irrelevancy since.

F5 is not to blame, they didn't change anything for the worse. The Plus-license is the problem where essential things like monitoring are behind a paywall. Back then this wasn't so important because you basically only had Apache and nginx.

I think I read two weeks ago what F5 was going to focus more on improving the open source version. Probably because the competition is getting harder and they're noticing it in a market share decline, but whichever the reason is, this was good to hear.

Also it was good to see it no longer being part of a Russian company, even though the devs and owners are good people. You never know how a government can enforce some problematic behavior, specially one which is known for liking to throw people out of high rise windows.

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

#57

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

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)

Not the person you're asking, but the culture around data representation strikes me as the biggest factor:

1. Only making valid states possible, to the greatest extent reasonably possible.

2. Treating error as regular data, not an afterthought - with language features to make that not too painful.

3. Not returning placeholder values (i.e. if you get back a parsed value from a parse function, it means it parsed correctly, not that either there's an error somewhere else or it parsed correctly).

Language features, in particular "enums" (aka algebraic data types, aka tagged unions), make this approach possible. You couldn't do it in go, for instance, even if there was a cultural decision to.

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

#58
post #14

Is it open source?

It will be. There will be a follow up blog post about the open sourcing with all the gory details of how it was built and how it works.

You may be interested in knowing that about two years ago, a team of engineers at Dropbox wrote gory details about their use of Rust and it was inspiring. The passion about their work really came through. The team also held an AMA on /r/rust that went well. See here: https://www.reddit.com/r/rust/comments/fjt4q3/rewriting_the_...

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

#59
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 a patch to a mailing list" style of contributions. Many contributions, my own attempt a decade ago, just get ghosted: https://mailman.nginx.org/pipermail/nginx-devel/2010-Decembe...

- Neither the contributing page (http://nginx.org/en/docs/contributing_changes.html) nor the Mercurial repo (http://hg.nginx.org/) redirect to HTTPS!

- Tests were a later addition and in a distinct repo with a bespoke harness. I'm sure it has advantages, but it also takes extra work for contributors to figure out.

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

I don't want to nitpick an excellent project like nginx, but I think it's clear that easing third party contributions has never been a high priority.

Post reply on HN