Live data from Hacker News

Production Twitter on one machine? 100Gbps NICs and NVMe are fast

thume.ca

251–260 of 500 posts

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#251

I am both embarrassed and disappointed with the negativity this post has attracted. A litanny of "gotchas", where someone attempts to best the OP. What about x, y and z? It can't possibly scale. Twitter is so much more than this, etc. The OP isn't making the assertion that Twitter should replace their current system with a single large machine. The whole thread paints a picture of HN like it is full of a bunch of hal…

If he would have called it anything else but Twitter and stated it is theoretical or a hobby project or something for fun, I would be fine with it, but don't mention Twitter anywhere near because it has nothing to do with Twitter.

A post like this without Twitter in the title isn't nearly as provocative, and would probably have died in /new. It's because of the authors decision to scope out a Twitter clone that we're having this discussion!

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#252
You have violated the number one rule in Silicon Valley: If it doesn't take at least "N" "engineers" to "solve" a problem who report directly to moi, then how am I relevant? So I agree this is entirely possible, but no one would build this with any funding.

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#253
post #62

He will be up for surprise. HTTP with connection: keep-open can serve 100k req/sec. But that's for one client being served repeatedly over 1 connection. And this is the inflated number that's published in webserver benchmark tests. For more practical down to earth test, you need to measure performance w/o keep-alive. Request per second will drop to 12k / sec then. And that's for HTTP without encryption or ssl handsha…

> Use HTTPS and watch it fall down to only 400 req / sec under load test [ without connection: keep-alive ]. I'm running about 2000 requests/s in one of my real-world production systems. All of the requests are without keep-alive and use TLS. They use about one core for TLS and HTTP processing.

Fascinating. Any special optimization you are using, or is it from off the shelf software and with standard configuration?

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#254
post #62

He will be up for surprise. HTTP with connection: keep-open can serve 100k req/sec. But that's for one client being served repeatedly over 1 connection. And this is the inflated number that's published in webserver benchmark tests. For more practical down to earth test, you need to measure performance w/o keep-alive. Request per second will drop to 12k / sec then. And that's for HTTP without encryption or ssl handsha…

I guess that the biggest chunk of a slowdown from TLS comes due to group operations alone. So wouldn't it be practical to configure TLS for session resumption and limit the number of handshakes per second it could do?

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#255
post #237

I'm going to preface this criticism by saying that I think exercises like this are fun in an architectural/prototyping code-golf kinda way. However, I think the author critically under-guesses the sizes of things (even just for storage) by a reasonably substantial amount. e.g.: Quote tweets do not go against the size limit of the tweet field at Twitter. Likely they are embedding a tweet reference in some manner or ot…

Biggest problem with this is the lack of considering analytics.twitter.com and ads.twitter.com. Twitter stores event data about everything that happens to a tweet, and lets you target ads with a lot of precision. While some of those writes may well be acceptable to lose, letting you write to caches, effectively you need to assume there are more analytics events triggering writes to something than there are tweet view…

A Twitter-like service that fits on a single server could probably get by with the reduced revenue that comes with not offering obsessively fine-grained analytics and ad targeting.

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#256

Earlier quoted context omitted.

> if it really was [which it isn't]

But many people including the OP think it is. It’s like me running a web crawler on my phone and saying I can replace Google.

If you were able to index the same amount of content you'd have a damn good alternative. And that's the level of this experiment.

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#257

Earlier quoted context omitted.

Quote tweets I'd do as a reference and they'd basically have the cost of loading 2 tweets instead of one, so increasing the delivery rate by the fraction of tweets that are quote tweets. Hashtags are a search feature and basically need the same posting lists as for search, but if you only support hashtags the posting lists are smaller. I already have an estimate saying probably search wouldn't fit. But I think hashta…

I don’t think that hashtags are a search only feature. In the posts themselves, the hashtags are clickable to view other tweets. I don’t think that qualifies as a search.

[deleted]

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#258

I'm going to preface this criticism by saying that I think exercises like this are fun in an architectural/prototyping code-golf kinda way. However, I think the author critically under-guesses the sizes of things (even just for storage) by a reasonably substantial amount. e.g.: Quote tweets do not go against the size limit of the tweet field at Twitter. Likely they are embedding a tweet reference in some manner or ot…

> I have no insider knowledge but I suspect that index is maybe the second largest thing on disk on the entire platform, apart from the tweets themselves.

I'd probably go as far to say that the indexes _generally_ at twitter could be larger than the tweets

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#259

Earlier quoted context omitted.

> just shuffling tweet sized buffers to network offload cards Except that's not what it is doing at all. It assembles all the Tweets internally, applies an ML model to produce a finalised response to the user.

> if it really was [which it isn't]

Maybe it should be, though?

I sometimes wonder how much value ML provides vs a proper sort function for anything but advertising.

Re: Production Twitter on one machine? 100Gbps NICs and NVMe are fast

#260

TFA, to me, touches about something I've wondered about a very long time ago: what are the implications of CPU and storage growing at much faster rates than human population? Back in the 486 days you wouldn't be keeping, in RAM, data about every single human on earth (let's take "every single human on earth" as the maximum number of humans we'll offer our services to with on our hypothetical server). Nowadays keeping…

TFA, to me, touches about something I've wondered about a very long time ago...

It was a little more than ten years ago for me. I realized that a hard disk could store a database of every human alive, including basic information, links (family relations) and maybe a photo.

I still don't know what the implications are.

Maybe we don't want to know, but it's not really that difficult to think about.

Post reply on HN