Live data from Hacker News

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

twitter.com

151–160 of 376 posts

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

#151

I'm 15 years in writing high performance Internet servers in C++, and I can confirm higher level languages provide an illusion of capability, but once you're talking high performance with high compute requirements and scaling your service, the cost efficiency of C++ is exponential better than any other language. The higher level language ecosystems are bloated beyond repair. I was able to use one 32-core physical ser…

This sounds like an amazing war story that I just want to hear more of. Is there any more? What's your c++ stack like?

Currently using Restbed (https://github.com/Corvusoft/restbed) as the server core, wxWidgets as a server side gui, with Boost, Curl, SQLite and Standard Lib. It's not that complex, beyond using lambdas in a few places. It has extremely high performance, and can run on an Intel Compute Stick, but I tend to use an Intel Nuc at minimum, with clients typically using whatever they have, gaining over redundancy and an ability to pair down. The memory management in a C++ application is just another resource one manages with whatever level of algorithm support you feel comfortable. There are ref-counting systems and complete garbage collectors available one can integrate into their business logic, unlike in a high level language that "transparently" manages memory outside application control. Have you ever thought about how much processing a typical 3D video game performs every frame? What if that caliber of optimized algorithm logic were handling a rich media, non-3D game server hosted business application? It would have pretty amazing performance and scale very economically. That's what I do. Before doing this, I wrote 3D video games and their production environments.

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

#152
post #117
post #112

Earlier quoted context omitted.

This sounds like an architecture problem, not a language problem. Can you elaborate?

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.

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

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

#153
post #146
post #92

Earlier quoted context omitted.

Stack overflow hosts all (most?) Of their own baremetal servers in their own data center. Looking at the specs of the machines, they are actually pretty basic as far as servers go. A server isn't barely worth the cost of it's chassis and motherboard if you put less than 64 G ram and 24 CPUs in it. In other words, these are about the lowest specd proper servers you can get. So yeah, even their modest hardware is still…

"Their own data center" implies (to me at least) that they built their own data center. That doesn't sound right, so I looked it up, and it seems like they're colocating. That might be what you meant, but the data centers they use certainly weren't built or owned by SO.

As far as I can tell, you are correct. They manage their own metal servers/racks inside a colocated data center. Sorry if this caused confusion.

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

#154
post #58
post #52

vibe.d is well worth a look: https://vibed.org/

Isn't D dead practically? https://news.ycombinator.com/item?id=21902953

I really like a lot of the ideas in D, but I feel like the language suffered from having too many ideas/features.

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

#155

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…

But nobody in BigCo(tm) would do that, because everyone (including the executives) involved want to have Hadoop/BigData(tm) in their resume. /sarcasm

No doubt there are people who do it for cynical reasons. But at least some people do it sincerely thinking it’s the right choice. It’d be more interesting to talk about them, and how they came to make the wrong decision for what they thought were the right reasona.

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

#156

Many developers severely underestimate how much workload can be served by a single modern server and high-quality C++ systems code. I've scaled distributed workloads 10x by moving them to a single server and a different software architecture more suited for scale-up, dramatically reducing system complexity as a bonus. The number of compute workloads I see that actually need scale-out is vanishingly small even in indu…

Can you expand on this? I have some pretty massive compute loads that need to be scaled onto a cluster with 100+ workers for most computations. This is after I use a library called dask that graphically does its own mapreduce optimisation inside its modules. This is all for a relatively small 250GB raw data file that I keep in a csv (and need to convert to SQL at some point). Are you saying this can be optimised to f…

Don't know why you're being downvoted but I'll assume your question is genuine.

You use a cluster when your data and compute requirements are large and parallel enough that the tax paid on network latency trumps the 10-20X speedup you get on SSD and 1000X speedup you get from just keeping data in RAM.

250 Gigs is tiny enough that you could probably much get better performance running on high memory instance in AWS or GCP. You'll generally have to write your own multiprocessing code though which is fairly simple - your existing library may also be able to support it.

I once actually ran this kind of workload on just my laptop using a compiled language that performed better than pyspark on a cluster.

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

#158
post #117
post #112

Earlier quoted context omitted.

This sounds like an architecture problem, not a language problem. Can you elaborate?

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.

Sometimes in a specialized team, the difference between 100 servers and 10 is profitability. Don't want to get laid off because that cloud bill is $100k a month.

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

#159
post #62

Earlier quoted context omitted.

Two. The number is two. You always need a backup server :)

I used to think that. But there are a couple of notable exceptions at either end of the latency spectrum. If your latency requirements are slack, then you can get away with one machine, because you can reboot or reprovision it and carry on processing without meet your requirements. If your latency requirements are tight, you don't have time to fail over anyway, so you might as well run one machine and make sure you c…

This is why I ran Redis on a single server with no failover strategy. Our team spent maybe 15 hours workshopping a handful of other things (redis cluster, sentinels + replicas) before realizing we could spend an hour to have everything sit in a degraded state working around it while Redis itself was fixed. Redis only failed once ever and it took all of an hour to fix it, all during non-peak hours.

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

#160
post #155

Earlier quoted context omitted.

But nobody in BigCo(tm) would do that, because everyone (including the executives) involved want to have Hadoop/BigData(tm) in their resume. /sarcasm

No doubt there are people who do it for cynical reasons. But at least some people do it sincerely thinking it’s the right choice. It’d be more interesting to talk about them, and how they came to make the wrong decision for what they thought were the right reasona.

I think it's a bit presumptuous to say that the decision is "wrong". That paper demonstrated that a single server can outperform a small server farm on a toy problem. Nobody, not even google, solves pagerank in production as a batch job. Real problems are often more complex.
Post reply on HN