Live data from Hacker News

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

thume.ca

111–120 of 500 posts

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

#111
post #63

In the coming years we will probably see a lot of complicated microservice architectures be replaced by well-designed and optimized Rust (and modern C++) monoliths that use simple replication to scale horizontally.

Replication and simple never belong in the same sentence. DNS which is one of the simplest replication systems I know of has its own complex failure modes.

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

#112
post #12

I like this kind of exercise. One thing I am not seeing is analytics, logs and so forth that as I understand it are significant portions of Twitter's production cost story.

Anyone have a complete list of functional blocks that form Twitter? Beyond the obvious and what we see?

You need the blocks for the obvious for what we see because it is not necessarily obvious to everyone.

Over the last couple of months I've seen comments that summarise Twitter as a read-only service that doesn't have any real time posting requirements and similarly other comments that treat it as a write-only service with no real time read / fast search requirements.

Without _all_ the blocks even the simple surface level Twitter will have complexity people miss.

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

#113

> colo cost + total server cost/(3 year) => $18,471/year Meanwhile the company I just left was spending more than this for dozens of kubernetes clusters on AWS before signing a single customer. Sometimes I wonder what I'm still doing in this industry.

Techies in tech industry are basically eating the rich .. A lot of buzzword to suck investment money in.

Or rather cloud providers are eating the rich. Techies are carrying the plates.

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

#114

Earlier quoted context omitted.

That doesn't really seem like an example, since the whole thing doesn't run one machine. The database alone has multiple machines.

> That doesn't really seem like an example, since the whole thing doesn't run one machine. It is an example. It shows you how you can run a service that issues a few hundred million SSL certs a year off relatively few pieces of hardware, i.e. no need to go drinking the cloud Kool aid. There will never be a "perfect" example. The overall point here is demonstrating that the first answer to everything doesn't have to i…

Last I read, Hacker News was still running on one big machine. And still uses text files as its database.

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

#115

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…

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…

[flagged]

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

#116
post #67

Earlier quoted context omitted.

I go with k8s even on a single server nowadays, it just makes everything so much more convenient. https://k3s.io/ makes it really easy to set up, too.

I never tried k3s, but what's wrong with kubeadm? I think that's literally two commands to run single server k8s: kubeadm init and kubectl taint something. The only thing bad about single server kubernetes is that it'll eat like 1-2 GB of RAM by itself. When you whole server could be 256 MB, that's a lot of wasted RAM.

Nothing wrong with kubeadm, but k3s should be a bit more lightweight.

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

#117

I think one of the under-estimated interesting points of twitter as a business is that this is the core. Yes, Twitter is 140 characters, it's got "300m users" which is probably 5m real heavy users. So yes, you could do a lot of "140 characters, a few tweets per person, few million users" on very little hardware. But that's why Twitters a shit business! How much RAM did your advertising network need? Becuase that is w…

The author claimed early on, and very clearly that this was a fun exercise of thought and engineering rather than saying “Look this is how Twitter should be run”. After all this is Hacker News. Such exercises, and engaging other hackers to pick something out of there is how we progress(and get our tickles). So, may be instead think about how one could tackle the advertising/indexing needs in a similar fashion(could it be done in just another server? 5 more servers?)..

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

#118
post #64

Earlier quoted context omitted.

In addition, you should worry about what happens to your app if a hardware error, network problem or natural disaster makes your machine unavailable.

Split the DB from the app and replicate with a load balancer?

That database is going to need to be clustered as well for resiliency.

Sounds like you already have quite a number of different containers already.

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

#119

Good analysis. Obviously, this doesn't handle cases like redundancy and doesn't handle some of other critical workloads the company has. However, it does show how much real compute bloat these companies actually have - https://twitter.com/petrillic/status/1593686223717269504 where they use 24 million vcpus and spend 300 million a month on cloud.

> However, it does show how much real compute bloat these companies actually have No, it doesn’t. It’s a fun exercise in approaching Twitter as an academic exercise. It ignores all of the real-world functionality that makes it a business rather than a toy. A lot of complicated businesses are easy to prototype out if you discard all requirements other than the core feature. In the real world, more engineering work oft…

Genuinely asking, why do you think Twitter needs 24 million vcpus to run?

This is not apples to apples but Whatsapp is a product that entirely ran on 16 servers at the time of acquisition (1.5 billion users). It really begs the question why Twitter uses so much compute if there are companies that have operated significantly more efficiently. Twitter was unprofitable during acquisition and spent around half their revenue on compute, maybe some of these features were not really necessary (but were just burning money)?

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

#120
post #7
post #6

Earlier quoted context omitted.

Ok, we've put a question mark up there to make it more explorationy.

As the author, this sounds good to me! I'll probably even change the actual title to match. I originally was going to make it a question mark and the only reason I didn't is https://en.wikipedia.org/wiki/Betteridge%27s_law_of_headline... when I think the answer is probably "could probably be somewhat done" rather than "no".

Well this may be the first time that's ever happened :)

Betteridge antiexamples are always welcome. I once tried to joke that Mr. Betteridge had "retired" and promptly got corrected about his employment status (https://news.ycombinator.com/item?id=10393754).

Post reply on HN