One machine can go pretty far if you build things properly (2022)
39 points by veqq
39 points by veqq
There are two reasons to want a second computer: performance and fault tolerance.
The interesting thing with the second is that, often, hardware is much more reliable than software. Yet people will scale to dozens of machines for fault tolerance, each running exactly the same codebase and vulnerable to the same faults.
For example, as far as I am aware, AWS is the only major cloud provider that runs more than one hypervisor across their fleet (they mix Xen and KVM and have some very exciting in-house stuff to migrate VMs between the two). The Verisign-run DNS root is a mix of Linux and FeeeBSD, each platform running two different DNS resolvers, so a vulnerability in one resolver or one OS will take out half of the servers but leave them able to operate.
In the ‘90s we learned that software monocultures were dangerous. And then we forgot and declared victory when we’d replaced one monoculture with a different one.
The interesting thing with the second is that, often, hardware is much more reliable than software. Yet people will scale to dozens of machines for fault tolerance, each running exactly the same codebase and vulnerable to the same faults.
In my mind, this is one of the key insights provided by Erlang, and perhaps one of the sources of its (and Elixir's) success, however modest it may be.
Relevant post: Not Just Scale by Marc Brooker.
There are more arguments in that post for moving to a "second computer," but interestingly a lot of them do technically fall under performance or fault tolerance. e.g. availability is directly related to faults.
often, hardware is much more reliable than software.
Not when you're buying 10 year old refurbished machines. Not when you are relying on single disks. Not when anything from a stupid power switch to a falling out ethernet cable can bring down your machine.
I've had relatively new power supply units fail and lock me out of my home network because I was relying on a single machine to let me in. A breaker tripping is more likely in my experience than the computer failing, but it is more likely.
I've said it many times, most websites could handle their traffic with a Raspberry Pi running PostgresSQL and a well written Go application with Vinyl-cache (aka "Varnish-cache") in front of it.
Shared PHP hosting services figured this out years ago. They ran hundreds of sites on servers that had the power of of 10 Raspberry Pis. Thanks to statistical multiplexing, they could handle significant traffic peaks on individual websites while oversubscribing customers.
What do you define as a "website"? Like, could a payment processor run their traffic on such a setup?
The 99% tail end the web.
In the 2000s, these were discussion boards, wikis and PBBG. All of this has now been cannibalized into walled garden such as discord, fandom and steam.
In the 2010s, they were e-commerce websites, photo galleries, CMS-based websites. They suffered the same fate with Shopify, Google photos and Squarespace.
Because all of this got centralized into multi-tenant mastodons, people think that we need k8s on AWS to run any small service, because all services are designed multi-tenant.
But look at Losters, the About section currently says:
Lobsters is hosted on three VPSs at DigitalOcean: a
s-4vcpu-8gbfor the web server, as-4vcpu-8gbfor the mariadb server, and as-1vcpu-1gbfor the IRC bot.
s-4vcpu-8gb is basically a Raspberry Pi, so it currently runs on 2 Raspberry Pis! And I suspect this is just headroom planning, I wouldn't surprised that even written in Ruby, it could take the load on a single s-4vcpu-8gb. So I'm sure it would totally fit if it was written in a more efficient language.
Heck, I'm pretty sure you don't need a go application in many cases, I wouldn't be surprised if a well configured web server running phpBB, DokuWiki, Drupal or PrestaShop on a Raspberry Pi would handle 100 QPS, which is ~10k daily users, that's a lot.
You could definitely handle payments for a medium to large business on a raspberry pi. But you're already thinking in terms of multi-tenant, like "Paypal", which is the issue.
I suppose the famous example here would be a search engine. AltaVista was handling eighty million hits a day and was the 11th most popular website of the year 2000. It all ran on a single DEC Alpha 8400 Turbolaser. I even found conflicting reports on the machine, but it had somewhere on the order of 10 processors (running under 1GHz) and between 6 and 28 gigabytes of RAM.
Now, I wouldn't try and run Google on a single server today, as the internet is far larger than it was in 2000. Still, getting 90 hits a second is an order of magnitude less load than was AltaVista was doing and a cheap commodity server is not an order of magnitude less powerful. If you're not doing something too computationally intensive (e.g. live video transcoding), then it should be possible to pull off a few million hits a day on a pretty cheap piece of hardware.
Depends on the payment processor, but, yes.
Visa has spikes of up to ~65,000 transactions per second. I think that one would need a beefier setup.
Visa isn’t a payment processor; they’re a card network. But there are also many smaller closed loop card networks that could easily be ran on a Pi. Think: gift cards, insurance, transport.
Considering that one big new machine is more than capable of handling the traffic most clusters service, especially if the clusters are more than a couple of years old, it seems like most people could stick with one machine with, at most, a single fallback machine. I suspect that most small teams use clustering work as an excuse to avoid their actual problems.
A kinder interpretation would be that they don't understand operations very well and thus their perceived needs and actual ones are different. From what I've seen management decisions in general tend to be overly defensive; it's easier to commit to an overbuilt design and justify spending $10k/month forever than it is to design for your actual needs, spend $500/month forever, and maybe need to change it later.
Of course, you'll have to change it later no matter what, but still.
Apart from being in a bedroom, this looks remarkably similar to what I saw when I visited the Hotmail datacenter in about 1998. Their backend “unit“ to run a shard of users was a Sun Enterprise file server and a bunch of generic PC mini-towers running BSD, lined up on shelves. It looked ridiculous, but made sense given the available offerings in those early years of Intel rack servers. Software-wise, I think they were all just running copies of the web UI backend, updated as needed with a shell script.