Live data from Hacker News

A lot of complex “scalable” systems can be done with a simple, single C++ server

twitter.com

181–190 of 376 posts

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#181

This is precisely the point made by McSherry, Isard and Murray in their lovely paper, "Scalability! But at what COST?" (Usenix HotOS '15). They demonstrate how much performance headroom there is in modern CPU and memory, and show how simple cache-sensitive batch algorithms running on a single core can outperform hundreds of cores running distributed map-reduce style jobs. https://www.usenix.org/system/files/conferenc…

Big data is about I/O not CPU

I’m a C++ veteran btw and understand the point but big data is about how to process petabytes of I/O not how to consume CPU.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#182
From this thread, I feel a lot of people misunderstand what a scaleable system means for a scale-up startup or BigTechCo. It doesn’t mean cost-efficiency. It means the ability to solve scalability issues at 10x, 100x, 1000x load by throwing money at it (aka buying more instances/machines).

Yes, John Carmack is right that a bunch of scaleable systems that see reasonable load, with well-understood traffic requirements could be rewritten more efficient ways. But how long would it take? How much would the extra work cost? And what would happen if traffic goes up, to another 10x, 100x? Can you throw still throw money at that problem, with this new and efficient system already in-place?

One of my memorable stories comes from an engineer I worked with when we rewrote our payments system[1]. He told me how at a previous payments company, they had a system that was written in this kind of efficient way, and needed to run on one machine. As the scale went up, the company kept buying bigger hardware, at one point buying the largest commercially available mainframe (we’re talking the cost being in the multi-millions for the hardware). But the growth was faster and they couldn’t keep up. Downtime after downtime followed at peak times, making hundreds of thousands of losses per downtime.

They split into two teams. Team #1 kept making performance tweaks on the existing hardware to try to get performance wins, and increase reliability during peak load. Team #2 rewrote their system in a vertically scaleable way. Team #1 struggled and the outages kept getting worse. Team #2 delivered a new system quickly and the company transitioned their system over.

What they gained was not cost savings: it was the ability to (finally!) throw money at their growth problems. Now, when traffic went up, they could commission new machines and scale with traffic. And they could eventually throw away their mainframe.

Years later, they started to optimise the performance of the system, making millions of $ in savings. The new system - like the old one - cost millions to run. But that was besides the point. Finally, they stopped bleeding tens of millions in lost revenue per year due to their inability to handle sudden, high load.

It’s all about trade-offs. Is cost your #1 priority and are you okay spending a lot of development time on optimising your system? Go with C++, Erlang or some other, similarly efficient language. Is product-market fit more important, with the ability to have high uptime, that you can buy? Use the classic, horizontally scaleable distributed systems stack, and worry about optimising later, when you have stable traffic and optimisation is more profitable over product development.

[1] https://blog.pragmaticengineer.com/distributed-architecture-...

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#183

From this thread, I feel a lot of people misunderstand what a scaleable system means for a scale-up startup or BigTechCo. It doesn’t mean cost-efficiency. It means the ability to solve scalability issues at 10x, 100x, 1000x load by throwing money at it (aka buying more instances/machines). Yes, John Carmack is right that a bunch of scaleable systems that see reasonable load, with well-understood traffic requirements…

(u meant they rewrote in a horizontal scaling way... Add more machines to a pool to scale)

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#184

From this thread, I feel a lot of people misunderstand what a scaleable system means for a scale-up startup or BigTechCo. It doesn’t mean cost-efficiency. It means the ability to solve scalability issues at 10x, 100x, 1000x load by throwing money at it (aka buying more instances/machines). Yes, John Carmack is right that a bunch of scaleable systems that see reasonable load, with well-understood traffic requirements…

(u meant they rewrote in a horizontal scaling way... Add more machines to a pool to scale)

Yes - thank you! Corrected.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#185

From this thread, I feel a lot of people misunderstand what a scaleable system means for a scale-up startup or BigTechCo. It doesn’t mean cost-efficiency. It means the ability to solve scalability issues at 10x, 100x, 1000x load by throwing money at it (aka buying more instances/machines). Yes, John Carmack is right that a bunch of scaleable systems that see reasonable load, with well-understood traffic requirements…

While that’s true, this is the same issue I have with Hadoop clusters which can easily be replaced by a single server and some grepping (well almost;))

Most companies or startups or even bigtech are not big enough for these problems.

All these complexities are horrible, but good for the AMZN stock price, as devs keep spooning up a ton of VMs

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#186
post #54

A site for proof. It keeps amusing me on what hardware/software Stack Overflow/Stack Exchange is running on: https://stackexchange.com/performance This is way less in HW than most people in the trade (from web devs to devops) seem to think when asked about it. SO ranks #36 in Alexa right now: https://www.alexa.com/siteinfo/stackoverflow.com

SO is really not a great example of a high traffic site. 5500 req/sec of mostly read only traffic is not that crazy at all, and their hardware footprint is incredibly over-provisioned for the workload. I don't really think their example stands well here.

For example, at work, our entire analytics ingest workload (HTTP) for a few hundred million users runs on 8 core VMs on GCP, written in Rust/Go, each node doing ~40k events/second.

Our RTC infra sustains >1m PPS per node on 4 core 3.9ghz 2014-2017 xeons.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#187
post #181

This is precisely the point made by McSherry, Isard and Murray in their lovely paper, "Scalability! But at what COST?" (Usenix HotOS '15). They demonstrate how much performance headroom there is in modern CPU and memory, and show how simple cache-sensitive batch algorithms running on a single core can outperform hundreds of cores running distributed map-reduce style jobs. https://www.usenix.org/system/files/conferenc…

Big data is about I/O not CPU I’m a C++ veteran btw and understand the point but big data is about how to process petabytes of I/O not how to consume CPU.

Yes, you are right. That said, the COST paper's presumption is that not every "big data" problem is big (petabyte size), that most probably fit in a single system's disk & memory.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#188
post #117

Earlier quoted context omitted.

Of course it's possible to write a horizontally scaled application in Java or C++. But once you have to deal with horizontal scaling anyway , language performance is much less of an advantage: as Carmack says, the difference between 100 servers and 10 is just accounting.

The Internet uses on the order of 10% of the world's electricity. A 10x difference is huge .

Out of curiosity - what's the source on that? Most figures I've seen put datacenter usage an order of magnitude lower:

e.g. https://www.iea.org/reports/tracking-buildings/data-centres-...

"Global data centre electricity demand in 2018 was an estimated 198 TWh, or almost 1% of global final demand for electricity (Masanet et al., 2018)."

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#189
post #178

Earlier quoted context omitted.

Spoken like an individual contributor far enough down the ladder to not have to worry about the bill.

In my experience it's the individual contributors who are overly obsessed with being elegant and efficient in their use of machine time. Those who are conscious of the bigger picture tend to have a more accurate sense of the relative costs of machine time versus engineering effort.

Multiplying your datacenter bill by 10 because you couldn't be arsed to spend two days thinking about system architecture isn't an "accurate sense of the costs" in any universe, except the one where you're spending venture capital bucks and waiting to get quckly bought by a Google with more free money than they can count.

Re: A lot of complex “scalable” systems can be done with a simple, single C++ server

#190
post #113

As someone who has implemented a complex system in C++ in this decade, I’d say he’s not wrong, but you need to carefully weight the pros and cons. In our case latency and real time demands mattered a lot (NASDAQ feed parser), to the point of the (potential) slowdown of a garbage collector kicking in was enough to rule out Java and .NET. It runs entirely in memory and on 64+ cores. We implemented our own reference cou…

I've seen state-of-the-art low-latency trading software written in C# or Java. You should not be doing any memory allocation in the critical path anyway, so garbage collection is hardly a relevant factor.

Having written lot of Java, Scala and C++ (and recently some Rust), I must say it is much easier to avoid heap allocations in C++ and Rust than in GCed languages, thanks to explicit allocation on the stack and pass by value + move semantics.
Post reply on HN