News for hackers. Stuff that matters.
Re:Ask HN: How does HN manage to be always online? by nik736 on Tuesday June 21, 2022 @04:17AM (#31821564)
A single bare metal server is more reliable than most people think it is. Complexity adds a lot of overhead and layer after layer that could possibly fail.
Re:Ask HN: How does HN manage to be always online? by srer on Tuesday June 21, 2022 @05:28AM (#31822005)
A single server is much faster than most people think, too!

In the microservice or serverless arrangements I've seen, data is scattered across the cloud.

It's common for the dominant factor in performance to be data locality, most times this talk about data locality is about avoiding trips to RAM, or worse disk. But in our "modern" distributed cloud things, finding a bit of data frequently involves a trip over the network. In the monolith world what was once invoking a method on an account object, has become making a HTTP POST to the accounts microservice.

What might have been a microseconds operation in the single server world, might become hundreds of milliseconds in the distributed cloud world. While you can't horizontally scale a single server, your 1000x head start in performance might delay scaling issues for a very long time.

A most excellent paper related to this topic that I think should be mandatory reading before allowing anyone an AWS account is http://www.frankmcsherry.org/assets/COST.pdf :)

Re:Ask HN: How does HN manage to be always online? by bayindirh on Tuesday June 21, 2022 @05:49AM (#31822134)
When you give half the effort to set things up properly, a single server can handle a lot of load and traffic, and get a lot of things done.

If you know some details of the services you're going to host on that hardware, the things you can do while saving a lot of resources is considered as black magic by many people who only deploys microservices to K8S systems.

...and you don't need VMs, containers, K8S and anything.

Re:Ask HN: How does HN manage to be always online? by GGfpc on Tuesday June 21, 2022 @12:26PM (#31825801)
What are those details?
Re:Ask HN: How does HN manage to be always online? by bayindirh on Tuesday June 21, 2022 @05:15PM (#31829191)
It generally boils down to three things: 1) How much resource a service need to run well, 2) How much the service wants to consume if left unchecked, 3) How performant you want your service to be.

After understanding these parameters, you can limit the resources of your application by running it under a cgroup. Doing this won't allow a service to surpass the limits you've put onto it, and cgroup will pressure your service when it nears its resource limits.

Also, sharing resources is good. Instead of having 10 web server containers, you can host all of them under a single one with virtual hosts, most of the time. This allows good resource sharing and doing more with less processes.

On the extreme case, I'm running a home server (DNS server, torrent client, synching client, a small HTTP server and an FTP server with some other services) under a 512MB OrangePi Zero. The guy works well, and never locks up. It has plenty of free RAM, and none of the services are choking.

Re:Ask HN: How does HN manage to be always online? by codethief on Tuesday June 21, 2022 @07:43PM (#31830419)
I agree but at the same time: Inter-process communication is also faster when a process is allowed to write to or read from another process's memory. Doesn't make it a good idea, though.
Re:Ask HN: How does HN manage to be always online? by bayindirh on Wednesday June 22, 2022 @02:16AM (#31832603)
The way I deploy them doesn't mean "compromise one, compromise all". For example, I generally leave SELinux intact. So they're properly isolated.
Re:Ask HN: How does HN manage to be always online? by moralestapia on Tuesday June 21, 2022 @07:08AM (#31822553)
Yeah, nowadays you could just scale-up and still have a lot of leeway. A high-end server (w/ redundancy maybe) is more than enough for 95% of all common startup use cases.

Distributed computing only makes sense when you're starting to deal with millions of daily users.

Re:Ask HN: How does HN manage to be always online? by efortis on Tuesday June 21, 2022 @08:02AM (#31822892)
Yes. HN works well with one dual socket server (2 x 4)

A new server could have 4 × 64.

Also, to distribute the load you can use an ‘A’ DNS record per server:

https://blog.uidrafter.com/freebsd-jails-network-setup

Re:Ask HN: How does HN manage to be always online? by awoimbee on Tuesday June 21, 2022 @11:42AM (#31825225)
To be fair you can run a microservices stack on a single server and it will be very fast, especially if you use gRPC instead of HTTP
Re:Ask HN: How does HN manage to be always online? by postalrat on Tuesday June 21, 2022 @12:36PM (#31825928)
Would grpc make a huge difference if requests took a second each?
Re:Ask HN: How does HN manage to be always online? by iso1631 on Tuesday June 21, 2022 @06:20AM (#31822279)
I think the main risk of the HN architecture is that (I believe) it's a single datacentre in a single location. Hopefully they have offsite backups.

The other risk I guess would be that all the NS are AWS/route53 severs, so if that went down they'd be up for about a minutes (looks like the DNS TTL is 2 minutes).

You could host your own NS servers in two different locations on two different providers, you could have a third hot spare server ready to go too, that would allow the service to survive an earthquake flattening San Diego (off site server ready to go), and cope with the loss of AWS DNS. Whether the cost/benefit ratio is there is another matter. I think the serving side of route53 is fairly reliable though (even when the interface to update records fails on a frequent basis), and the cost of being down isn't particularly terrible.

Re:Ask HN: How does HN manage to be always online? by barelysapient on Tuesday June 21, 2022 @09:58AM (#31824017)
> I think the main risk of the HN architecture is that (I believe) it's a single datacentre in a single location.

Exactly, Amazon US EAST makes the same point several times a year! :)

Re:Ask HN: How does HN manage to be always online? by systemvoltage on Tuesday June 21, 2022 @01:59PM (#31827048)
We should ask this question to ourselves: As a user, if I have to manage the risk of US-East-1 going down, may be we should question this entire Cloud thing. It was marketed as "100% bulletproof" in 2005 when we discarded on-prem.
Re:Ask HN: How does HN manage to be always online? by iso1631 on Wednesday June 22, 2022 @05:05AM (#31833569)
To be fair to amazon I don't think they've had an outage that affected different data centres at the same time, but yes I would far rather have my main and backup on two providers in two appropriately diverse locations.
Re:Ask HN: How does HN manage to be always online? by dopp0 on Thursday June 23, 2022 @07:54AM (#31847776)
but never forget that AWS uses us-east-1 to host core services that, when they go down, they take almost the whole thing down, no matter which region.
Re:Ask HN: How does HN manage to be always online? by iso1631 on Thursday June 23, 2022 @08:49AM (#31848311)
Which specific services?

I only use VMs and route53, and form what I've seen when us-east-1 is down I can still resolve my domains

Re:Ask HN: How does HN manage to be always online? by JonAtkinson on Wednesday June 22, 2022 @04:42AM (#31833438)
What is the downside for a user to have a few minutes of downtime?

What is the upside for HN to add this engineering complexity to avoid a couple of minutes of downtime?

Re:Ask HN: How does HN manage to be always online? by iso1631 on Wednesday June 22, 2022 @05:03AM (#31833556)
For HN it probably doesn't matter, although what's the value

For Amazon too it probably doesn't matter -- if I occasionally can't buy something I'm almost certain to simply try again 30 minutes later

For some services a couple of minutes of downtime isn't good enough. Imagine if the superbowl went dark for 5 seconds just as the winning play happened.

Re:Ask HN: How does HN manage to be always online? by tomsmeding on Tuesday June 21, 2022 @06:34AM (#31822345)
> A single bare metal server is more reliable than most people think it is.

Well, two, presumably. Otherwise you can't reboot without taking the website offline.

Re:Ask HN: How does HN manage to be always online? by stavros on Tuesday June 21, 2022 @08:58AM (#31823354)
Sometimes that's fine, we can go without HN for five minutes once every few months.
Re:Ask HN: How does HN manage to be always online? by theandrewbailey on Tuesday June 21, 2022 @12:43PM (#31826043)
Few months? I notice HN down for a few minutes about once a week.
Re:Ask HN: How does HN manage to be always online? by NorwegianDude on Tuesday June 21, 2022 @10:45PM (#31831489)
If you want it to be online, why turn it off or reboot in the first place? You can run updates without rebooting, at least on Linux.
Re:Ask HN: How does HN manage to be always online? by tomsmeding on Wednesday June 22, 2022 @02:02AM (#31832560)
Can't replace the kernel though, and updating the web server application itself is going to be hard too. Unless it's some Erlang like hotpluggable server I guess.
Re:Ask HN: How does HN manage to be always online? by fragmede on Wednesday June 22, 2022 @02:27AM (#31832663)
> Can't replace the kernel though

Yes you can, since 2008. https://en.wikipedia.org/wiki/Ksplice

Re:Ask HN: How does HN manage to be always online? by jazzyjackson on Tuesday June 21, 2022 @05:06AM (#31821872)
Obligatory Lamport quote: "A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable."