News for hackers. Stuff that matters.
Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by freecodyx on Monday September 10, 2018 @07:41AM (#17951021)
i will add to not use the default http.Client/Server,

poor performance, instead use fasthttp

Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by acln on Monday September 10, 2018 @07:55AM (#17951098)
I like my HTTP package to actually speak as good an approximation of HTTP as it can, so fasthttp wouldn't be my first option.

Furthermore, the HTTP stack doesn't show up on most web servers' profiles. net/http is better understood by the community, interoperates with libraries better (e.g. golang.org/x/oauth2), and is better supported.

Use net/http.

Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by ErikDub on Monday September 10, 2018 @10:05AM (#17951869)
The main issue with net/http is that it generates a lot of garbage which is definitely going to show up in your profile if you're handling a lot of requests per second.
Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by sagichmal on Monday September 10, 2018 @11:31AM (#17952508)
Allocation pressure imposed by net/http has never been a top K source of profile CPU burn in any service I’ve ever written, and I’ve written plenty of high-performance, high-QPS services. fasthttp is rarely if ever a good idea.
Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by kasey_junk on Monday September 10, 2018 @09:20AM (#17951588)
This is terrible advice for something serving broadly to consumers.

Fasthttp is great if you can limit your interactions to a minor testable subset of calls but otherwise its not suitable.

Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by remoteorbust on Monday September 10, 2018 @11:27AM (#17952484)
First off, the author of fasthttp has made some great packages that I do use in production.

However, last time I looked fasthttp was great if you don't care about http2 support or streaming bodies. Unfortunately I do.

Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by ainar-g on Monday September 10, 2018 @07:51AM (#17951073)
IIRC, fasthttp only supports a subset of HTTP. This may or may not be a deal-breaker for some people.
Re:Lessons from Building and Scaling Reddit's Ad Serving Pla... by ErikDub on Monday September 10, 2018 @10:04AM (#17951853)
It serves everything that is required for an ad-server.