Live data from Hacker News

Majority of web apps could just run on a single server

old.reddit.com

61–70 of 251 posts

Re: Majority of web apps could just run on a single server

#61
post #9

I can confirm. I've had quite a few projects that made it to the front page of HN and handled the traffic like cake. All of them ran on 5$ digital ocean droplets. I accept some projects are more resource expensive than others, but majority of the time you can get away with a bit of asynchronous responses + scheduler/queue to spread the load horizontally over time. Unpopular opinion: I blame the new age devops culture…

> I've never come across a devops person who'd say "Hey, that sofware is too simple to prematurely scale for sudden spikes of irrational amounts of traffic, so why not just deploy it on a cheap vps?"

Was a devops engineer at my previous job.

We already had k8s clusters setup, pre-made CI templates and pre-tailored helm charts (along with monitoring and much more). All those things you (a developer) could mostly clone, slightly customize and ship both to a development k8s cluster and to a prod k8s cluster (with all the safety nets already in place).

Creating (and maintaining) a single vm for a pet project is way more work than using the pre-made and pre-customized and curated toolkit.

This was at a 100+ developers organisation.

If you think you could easily get off with a single vm then you've never seen devops done right, i'm fairly sure.

EDIT: I probably fell for the bait, but the post i'm replying to really made me remember why we went on a killing spree in order to eradicate everything that was not k8s at my previous job and removing as much developer access to prod as possible. Some idiot developers think they know better, usually end up re-inventing a square wheel that breaks as soon as it's not running on their laptop anymore.

Re: Majority of web apps could just run on a single server

#62
post #46

Earlier quoted context omitted.

Pretty much any provisioned vm can be split down the middle. Got 4 cpus and 4gb of ram? Congrats you have two vms with 2 cpus and 2gb of ram. Throw them into a 50/50 load balancer and never have any downtime.

Two vms on the same machine doesn't help when the machine fails. Also, I sure hope your loadbalancers don't suck. I've worked with some that had worse uptime than my servers, and worse capacity too. Went back to putting the two host addresses in DNS, which is mostly fine, but means a lot of waiting when you want to take a host out of rotation for disruptive maintenance.

I do this on AWS so the load balancer is managed for me. Never had issues. Two randomly provisioned vms are unlikely to be on the same bare metal.

Re: Majority of web apps could just run on a single server

#63

Can the majority of webapps run on a single machine? Probably. Do most of your customers expect close to 100% uptime? Yes. Does one machine provide the uptime required by your customers? Most definitely not.

I don't think the point here changes all that much if you change this to two servers and a load balancer. That's still a pretty simple setup. But I also think that many applications are far more tolerant of small outages than you imply. And a more complex setup also adds more points that can lead to an outage even though it reduces the chance that hardware will cause one.

Nearly no one is competent and able to setup a true load balancer. If you have one either it’s provided by your (most likely vm based) hosting provider or you are a big enterprise.

If you are in one of those two categories then setting up something more robust than a single server isn’t much more complicated than a single server.

That is to say, I think it very much does change the equation around the original statement.

Re: Majority of web apps could just run on a single server

#64

If your app doesn't server more requests than sqlite.org daily, you shouldn't pay more than it. > sqlite.org answers more than 500,000 HTTP requests per day (about 5 or 6 per second) delivering about 200GB of content per day (about 18 megabits/second) on a $40/month Linode. The load average on this machine normally stays around 0.5. [0]: https://sqlite.org/althttpd/doc/trunk/althttpd.md

I mean it really depends on what your doing.

If you’re just serving static content then of course you can get away with one small box.

If you have user content that’s being constantly updated and inserted you need a lot more.

You need databases, caches, and in our case elastic search (with ~10 billion documents). The data needs to be indexed 16 ways to Sunday to make sure that a user hitting the page with this filter or that sort selects just the right records.

If you care about reliability you should have read replicas of your DBs as well.

Where are your logs going? I’d expect servers for that as well.

Now alternative to a bunch of this you could just use SaaS products but that costs an arm and a leg.

Re: Majority of web apps could just run on a single server

#65
post #51

I once worked a job where I easily spent 4 times as much time fighting with Terraform files than actually writing features. This company got less than 1,000 hits per day. I think about this a lot

I've had gigs where it felt like the company was spending more time fighting self-inflicted consequences of their "best practice" "cloud-native" architecture than developing actual revenue-generating features.

So many problems they were dealing with would magically disappear if all the services were running on a single high-end physical machine (the scale didn't mandate anything bigger than that) with a standby one sitting in a different DC for redundancy purposes with incremental DB snapshots shipped to it every 15 mins.

The cloud-native, "modern" infra became a liability and impediment to business but too many people would lose face to admit it.

Re: Majority of web apps could just run on a single server

#66
What kind of systems are people imagining when they picture 'the majority of web apps'?

In this thread, I see people citing HN (a simple bulletin board system); or sites that will get linked from HN and have to handle load - so, presumably blogs, or CMS-backed marketing sites, maybe with a sign-up form or a single product ecommerce storefront?

Sure, I can buy that you can run a pretty robust bulletin board or CMS on a single server. PhpBB and Wordpress with a Postgres backend will get you a long way.

But if you think that's what all web apps are like, you're not thinking anywhere near big enough. "I've seen some stuff that's over engineered" is not evidence for "everything is over engineered".

Re: Majority of web apps could just run on a single server

#67

Earlier quoted context omitted.

I'm convinced it's the hiring that has shaped the scene. If you're hiring, you want to be able to add/replace people as easily as possible. If you're being hired, you want to charge as much as you can. And to satisfy those two demands, the current web stack is great. Almost like it's been built for it. It's got very little to do with the tech itself, a lot more to do with market dynamics. That's the problem it's tryi…

The root cause is the decade of zero interest rates which led to companies intentionally overcomplicating their stacks to justify neverending VC rounds. Early prospective employees took notice and adjusted their skills as a result. The dangerous part is that in the meantime we've got brand new and budding talent that actually took this charade seriously and effectively got high on their own supply, seeing this perfor…

> The root cause is the decade of zero interest rates which led to companies intentionally overcomplicating their stacks to justify neverending VC rounds.

Extended hot take: the true customer of a company are the current and prospective holders of capital, whether VC, private investment, or public markets. Keeping them happy is the main goal of the exec.

If your owners' portfolios include real estate, you push "back to the office". If it includes container startups, you deploy on k8s. Your "strategic partnerships" are determined by how much your owners care about propping up investment A investment B.

Re: Majority of web apps could just run on a single server

#68

In fact, a single five euro server can run: My personal website, Two multiplayer game servers for the games I built, frp for tunnelling; and I'm planning on squeezing more in until it gives up. All reverse-proxied by nginx under subdomains of my personal domain address, absolutely seamless. Similarly, other applications I built so far all also run under five euro VMs. There's no denying you might need more because yo…

> Similarly, other applications I built so far all also run under five euro VMs. There's no denying you might need more because you have serious peaks in traffic that you cannot handle with only one server, but do the accounting.

A simple proportional-integral-derivative controller equipped onto your server resource can help you see if future traffic spikes are occurring. The question is, what kind of person is able to have that kind of perception ability and is willing to integrate that into his daily life? Not the average software developer, we can definitely say with great confidence.

Re: Majority of web apps could just run on a single server

#70
Gonna throw out an anti-cirlcenjerk take:

We know. Absolutely no one has ever said that your super basic webapp that has the latency requirements of "make sure it works", an SLO of "it's fine most of the time", and a code base under 10k lines of code worked on by one guy, needs these super complicated systems. Even FAANG will run internal services and dashboards on a single binary, but when every second of downtime can be translated into lost money, then you begin to care.

Post reply on HN