News for hackers. Stuff that matters.
Re:Time Series and FoundationDB (2019) by javajosh on Saturday May 28, 2022 @11:18AM (#31540960)
"imagine you have a fleet of 50,000 servers..." It's interesting to consider when you would ever need so many servers, from first principles, considering that a single server can easily handle a million simultaneous connections, and very few applications are used by every man woman and child on Earth and even fewer are used by multiples of that.
Re:Time Series and FoundationDB (2019) by maccard on Saturday May 28, 2022 @01:28PM (#31542095)
I work on multiplayer video games, and our game servers are often stateful programs that persist for 10-60m. If you have 5 players per session and 250,000 peak concurrent users (remember that steam is only one platform, consoles exist too, as do mobile platforms), you can have 50k servers. Sure they're not necessarily 50k unique machines, but they might be container instances or just processes on a single box, but theres 50k individual processes doing "stuff"
Re:Time Series and FoundationDB (2019) by ClumsyPilot on Saturday May 28, 2022 @09:25PM (#31545374)
> you can have 50k servers. Sure they're not necessarily 50k unique machines

Props to game servers- they atlre more complex than much of eterprise software.

However this is a big distinction - depending on a game, 10 - 100 game istances could run on one physical machine

Re:Time Series and FoundationDB (2019) by maccard on Sunday May 29, 2022 @05:24AM (#31547751)
From the receiving end it doesn't matter whether they're unique machines, instances packed on one machine, containers on a machine or serverless nodes, it's still receiving updates from 50k processess though!

You also need to manage the complexity of packing those game instances onto the same machine for your game which is a whole other fish.

Re:Time Series and FoundationDB (2019) by hinkley on Saturday May 28, 2022 @01:03PM (#31541905)
My first scaled project, we were aiming at 30req/s per server. On UltraSPARC boxes, so maybe 8 cores? At a time when memcached was brand spanking new and thus not trustworthy, and F5 had just got their traffic shaping logic to actually work. We did it, but the architecture was terrible and we should have been able to do 50-100 req/s/s if we had taken certain principles more seriously.

My current project is doing 5x the traffic but with 20x the cores, it’s embarrassing. And that’s just counting “our” servers, which are only about 1/3 of the whole enterprise (heading toward 50% if I wasn’t on the scene). I look at all the waste in our project and then I think about why I would ever need 50k cores, let alone servers and I just can’t fathom it. Who is handling a tens of millions of requests per second? And what on earth are you fucking up so badly that you need 2 million servers? Is Google doing 4 billion requests per second?

At some point I have to ask myself if making it easy to manage more servers was really their best strategy. Often friction and constraints are where innovation comes from. When things are easy people don’t think about them until they are gone.

Re:Time Series and FoundationDB (2019) by morelisp on Saturday May 28, 2022 @01:19PM (#31542027)
> Who is handling a tens of millions of requests per second?

Speaking as someone less than one order of magnitude below that, it takes us about ~100-200 cores. (Depending on how you amortize shared infrastructure like our Kafka brokers, etc.) So even 10x'ing our infrastructure I can't imagine 50k servers.

Re:Time Series and FoundationDB (2019) by hinkley on Saturday May 28, 2022 @03:15PM (#31542897)
It's very reminiscent of that feeling when you were a child that adults have everything figured out, and so you're in a big hurry to get there because then everything will make sense.

Then that moment of dawning horror when you see that nobody knows what the fuck they're doing and everyone is faking it at best, and just a child playing dress-up at worst.

Google has certainly figured out a number of things, but anyone using 2.5 million servers in 2016 on a planet of only 7 billion people is playing dress-up.

Re:Time Series and FoundationDB (2019) by hazz99 on Saturday May 28, 2022 @09:04PM (#31545264)
I’d assume 2.5M refers to the number of containers, not physical machines. And that since containers are virtualised and largely a developer convenience, there’s not a big reason to try keeping that number low.
Re:Time Series and FoundationDB (2019) by kleton on Saturday May 28, 2022 @09:56PM (#31545553)
No, Google by around 2016 was running out of 10/8 addresses for their prod network and was urgently switching to ipv6
Re:Time Series and FoundationDB (2019) by yashap on Saturday May 28, 2022 @12:29PM (#31541615)
In 2016, Gartner estimated that Google ran ~2.5 million servers (https://www.datacenterknowledge.com/archives/2017/03/16/goog...), and it’s probably even more today. Obviously Google are an extreme outlier, but that’s 50x 50,000.

Most servers do far, far more compute intensive things than handling connections - that’s a pretty meaningless number. I work in the mobility space, we’ve got servers that solve large/complex vehicle routing problems, and ideally they’re performing computation for just ONE user at a time.

Certainly 50,000 servers is a lot, but tonnes of large tech companies run 100s to 1000s of servers at a time.

Re:Time Series and FoundationDB (2019) by javajosh on Saturday May 28, 2022 @12:50PM (#31541796)
Sure, but the simple Postgres soln the author mentions works for 1000 servers. Assuming a power law distribution, technology like this is useful for a vanishingly small number of organizations. What's even more interesting is that it's pure admin overhead for those looking to centralize control over vast numbers of systems. So often technologists are asked to consider the moral or political implications of their work, and I think this is a good opportunity to do so.
Re:Time Series and FoundationDB (2019) by Cthulhu_ on Saturday May 28, 2022 @12:09PM (#31541435)
Connections is fine, but applications do more than just accept connections, generally speaking.
Re:Time Series and FoundationDB (2019) by Johnny555 on Saturday May 28, 2022 @02:35PM (#31542592)
A single server can only handle a million connections if each "connection" is doing a trivial amount of work. There are lots of compute bound services that need more power than a single server (or even 50,000 servers) can provide.
Re:Time Series and FoundationDB (2019) by unboxingelf on Saturday May 28, 2022 @11:28AM (#31541044)
Not every problem is network or io bound. Imagine a system that ingests data from clients. Only a subset of the capacity may service client connections, while the rest may be running computations over data.
Re:Time Series and FoundationDB (2019) by foobiekr on Saturday May 28, 2022 @12:33PM (#31541643)
Basically in an ideal system you are only bound by hardware limits.

memory bandwidth bound

memory size bound

cache hit rate and bandwidth bound

TLB size bound

CPU decode and issue logic bound

CPU renaming / OOO buffer bound

kernel implementation bound (esp. locks, interrupts,...)

network physical layer bound

GPU/TPU bound (which are variations of the above, though mostly memory)

power and cooling bound

...

... so basically unless you're running out of functional units, you're hopefully I/O bound depending on where you consider i/o.

But in reality, most SW is just "crappy SW making poor use of resources bound." That's where we mostly are now as an industry. Bad language choices, terrible design, no cross-layer comprehension.

Re:Time Series and FoundationDB (2019) by legulere on Saturday May 28, 2022 @02:10PM (#31542433)
Having enough computing power to be able to write crappy software is an enormous productivity boost. Writing software with crappy performance is way easier than writing software with good performance and takes less time and less experienced developers. Writing crappy software is often better at achieving business goals as cheap as possible.
Re:Time Series and FoundationDB (2019) by jiggawatts on Saturday May 28, 2022 @05:27PM (#31544032)
There was a post (here?) about how Netflix uses NICs that offload TLS encryption because that’s literally the only way to hit 200 Gbps. It’s not that the CPUs can’t encrypt that fast — the limit is the memory bandwidth.

I see some clouds deploying servers with 100 Gbps NICs and I wonder what percentage of deployed applications could get anywhere near that…

Re:Time Series and FoundationDB (2019) by javajosh on Saturday May 28, 2022 @12:47PM (#31541766)
>But in reality, most SW is just "crappy SW making poor use of resources bound."

I agree, but the number one culprit is premature distribution, thanks to the widely pervasive cargo culting Amazon-style microservices.

Re:Time Series and FoundationDB (2019) by aserafini on Sunday May 29, 2022 @01:09AM (#31546583)
I often think about this. We have 100s of services running on 1000s of servers and 10,000s of containers but I wonder how much of that is ‘waste’ in the sense that we are running 10,000x Operating Systems, 100s of load balancers, database per service/region etc.

Seems possible that horizontal scaling at every layer can be wasteful, but the alternatives are hard for me to even conceive.

Re:Time Series and FoundationDB (2019) by javajosh on Sunday May 29, 2022 @12:27PM (#31550385)
Regarding container processes, it depends on how your containers are written. In the best case, each process is not so much an OS as a kernel instance - a kind of poor man's unikernel. It's an extremely stateless process that requires the bare minimum of the physical host.

The overhead that concerns me more is messaging. A network of N nodes has N! paths. In the general case it doesn't take long before the overhead of internal messaging absolutely dominates all other processing in the steady-state. Most people take a brute force approach of partitioning the network on purpose, or even intentionally bottle-necking (again) all the traffic. What's really hilarious is when you see people architecting microservices with kafka and apogee with all the uservice trimmings, only to deploy everything to a single physical rack, or even a single beefy machine.

I feel like the proper path to scalability goes through repeated breakage, because then you get to see how things actually break under load, and what can be done to fix it. For example, you can do a lot by moving logic to stored procs, or equivalently, moving your db into your application process. But people seem to think these are non-starters, for some reason, probably because the notion of stateless app servers as the key to horizontal scalability has become a Law, even though there are alternatives. But good luck questioning foundational assumptions - the risk is just too damn high.

Re:Time Series and FoundationDB (2019) by DSingularity on Saturday May 28, 2022 @02:14PM (#31542454)
“Cross layer comprehension” - what is that? Wanna move computation to the NIC ?
Re:Time Series and FoundationDB (2019) by foobiekr on Saturday May 28, 2022 @05:49PM (#31544182)
It is useful to understand the underlying layers so as to take advantage of what they are good at and not end up in the position of relying on operations where they perform badly.

"What is are the natural, performant operations for the layer below me? How can I construct my solution from these operations instead of pretending the layers are orthogonal?"

A good example would be the linear read/write performance of harddisks. If you had the option to avoid random access and take advantage of read-ahead and other methods you'd have seen much better performance than an approach that ignored this behavior.

There are many, many examples of this.

Re:Time Series and FoundationDB (2019) by astrange on Saturday May 28, 2022 @05:55PM (#31544224)
That is a good idea and we do that. (TSO/LRO/TLS offload)
Re:Time Series and FoundationDB (2019) by javajosh on Saturday May 28, 2022 @12:26PM (#31541582)
Yes, of course you might be CPU bound, in which case even a single user might take up 50k servers (think of a scientist doing a climate simulation, or an AI researcher building a very large model).

All things being equal, CPU-bound is the exception, not the rule. Most every program we think of as an "application" is chat with some structure, persistence, access control added, and are indeed IO bound.

Re:Time Series and FoundationDB (2019) by foobiekr on Saturday May 28, 2022 @12:26PM (#31541590)
Think differently about this problem.

Not all applications are web pages where the lifecycle of a given connection is "establish TCP, establish TLS, receive series of requests and produce series of responses mostly by hitting external caches or DBs" [or the QUIC variant of this]. That problem space was one of the very first scale challenges to arrive in 1998 and was one of the very first that actually got addressed. It's not the challenge space now and has not been, basically, for 20+ years, except perhaps the whole scaling-of-database problem, which has been dealt with by sharding, and the distribution of flows problem, which has mostly been solved with clever applications of intensely performant _scale-up_ hardware in the form of modern switch NPUs running variations of ECMP and clever uses of anycast, DNS load balancing, routing, etc.

All of this stuff was pretty common by the mid-2000s.

But bottlenecks in systems always exist. They move around. They can be anywhere in the stack.

Connections is the simplest one that got a lot of attention for twenty years - real pre-emptive threads (in Linux, and Solaris's weird diversion into m:n), select() scalability (both in terms of bookkeeping and in terms of basic limits - that is, the lack thereof) giving rise to kqueue on freebsd, WFMO() on NT and years of attempts on Linux to get something that actually worked, which took awhile, _then_ the c10k problem, and so on.

After connectivity you have issues in layer 3 - TCP offload, cost of TLS, etc. Userland to kernel copies (basic stuff like sendfile() to different userland driver schemes). And so on. Physical layer - servers move from NICs with lots of copies, to ring based with scatter-gather, to TSO, crypto offload, to ... while going from 10mb to 100, 1000, 2.5g, 10g, 40g, 100G and sooner or later 400G on server will not be as uncommon as it is now.

But as your networking capacity and throughput scale, you start bumping into other things. Once you're talking high speed links and various schemes to get the kernel out of the way, you are mostly - not always, but mostly - talking about data movement problems. Elephant flows have their own system level problems in networks, and for data moving and staging you actually don't want the host _cpu_ involved if you can avoid it, let alone the kernel. Now you are in the area of doing (remote)->NIC----PCIe---->NVME (or --->GPU) directly, if you can. Now your NVME storage device becomes the bottleneck.

90s era supercomputing clusters had all of these problems with slightly different technologies, AI clusters have them today. These are not connection limited, they do not scale with people. Their primary scale challenge is utilization/CAPEX, but that's a longer discussion.

Re:Time Series and FoundationDB (2019) by dchuk on Saturday May 28, 2022 @12:24PM (#31541562)
I work at a telematics company. Technically, every black box in a vehicle is a server, and we have much more on the road than that figure
Re:Time Series and FoundationDB (2019) by tilolebo on Saturday May 28, 2022 @11:25AM (#31541001)
> considering that a single server can easily handle a million simultaneous connections

Can you elaborate on that part?

Re:Time Series and FoundationDB (2019) by joisig on Saturday May 28, 2022 @11:33AM (#31541093)
Not the GP but they might be referring to [0] or one of several other articles you will find if you Google "handle a million connections in *".

Realistically you also usually need to perform some non-trivial work from time to time for some non-trivial portion of those connections, which will further load your server, but still.

[0] https://phoenixframework.org/blog/the-road-to-2-million-webs...

Re:Time Series and FoundationDB (2019) by crgwbr on Saturday May 28, 2022 @11:42AM (#31541196)
Genuinely curious on this—with port numbers only being 16 bits, how is it possible for one machine to ever handle more than 65k concurrent connections?
Re:Time Series and FoundationDB (2019) by pipe_connector on Saturday May 28, 2022 @11:47AM (#31541238)
Connections must have unique IP:Port pairs between client and server. You're limited to 65K concurrent connections for the same client. In practice, no one is opening that many connections from a single client.
Re:Time Series and FoundationDB (2019) by dtjohnnymonkey on Saturday May 28, 2022 @12:09PM (#31541440)
You might run into this limitation more quickly if you are receiving connections via a load balancer.
Re:Time Series and FoundationDB (2019) by adra on Saturday May 28, 2022 @12:38PM (#31541680)
As such, the load balancer itself can probably hold a group of source IPs to use as second-hop solution to this problem as well if we're sincerely talking about load balancers holding a ton of largely idle connections simultaneously.

The more likely load balancer outcome would be DNS split on inbound client IPs, and scaling out until each load balancer handles the appropriate amount of traffic (by some measure and scale out if exceeded).

Re:Time Series and FoundationDB (2019) by NavinF on Saturday May 28, 2022 @07:40PM (#31544857)
Only for L4 load balancers. L3 (switches doing ECMP) won’t modify source IP and L7 (e.g. nginx) will reuse TCP connections to the backend servers.
Re:Time Series and FoundationDB (2019) by dxhdr on Saturday May 28, 2022 @11:46AM (#31541230)
A connection is the tuple {source_ip, source_port, dest_ip, dest_port}
Re:Time Series and FoundationDB (2019) by alduin32 on Saturday May 28, 2022 @11:55AM (#31541310)
For outbound connections, it can be done using multiple IP addresses.
Re:Time Series and FoundationDB (2019) by SnowHill9902 on Saturday May 28, 2022 @11:28AM (#31541047)
I guess it’s just an example. It can be sensors, cars, apps, …