Re:Pingora, the proxy that connects Cloudflare to the Internet
by rowin on Wednesday September 14, 2022 @02:21PM
(#32841112)
Was Go considered as the language to write Pingora in? If so, why was Rust chosen?
[ Parent
| on HN ]
Re:Pingora, the proxy that connects Cloudflare to the Internet
by TheFlyingFish on Wednesday September 14, 2022 @02:54PM
(#32841610)
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)
Re:Pingora, the proxy that connects Cloudflare to the Internet
by 0x457 on Thursday September 15, 2022 @08:35PM
(#32860424)
Well, rust's async ecosystem is top-notch as long as you're writing a network load balancer...
Re:Pingora, the proxy that connects Cloudflare to the Internet
by ekidd on Friday September 16, 2022 @08:04AM
(#32864968)
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
by 0x457 on Sunday September 18, 2022 @04:24PM
(#32891163)
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
by riobard on Friday September 16, 2022 @08:10AM
(#32865024)
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.