Live data from Hacker News

Self-Hosting Dozens of Web Applications and Services on a Single Server

cprimozic.net

41–50 of 285 posts

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#41
post #36
post #21

I wonder what the environmental impact of a 24/7 running system with such high-end specs is. Desktops are worse with a graphics card (just yesterday I noticed my system's power consumption doubles when the GPU turns on: 20W with 100% CPU on all cores and WiFi stressed; 37W with additionally primusrun glxgears running), but desktops only run on demand. Dedicated non-mobile hardware doesn't scale to demand that well an…

I guess that in this very specific environment, the only practical reason against the Pis are the containers. Spotty support for ARM images seems to be a continued problem.

I didn't know that was a problem. I run all my services in containers (only service on the host is ssh) but it's all from Debian repositories and so would run on basically any architecture. I guess it depends on how specialized the software is that you require but what is built into Debian is quite extensive in my experience.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#42
post #28
post #12

Is your 64MB memory ECC? Why do you RAID-1 NVMe? They are likely to fail simultaneously so maybe make them independent and schedule regular backups from one volume to the other, or to a remote disk drive somewhere.

Raid-1 is doing exactly what you recommend without any effort. A perfect replica of the disk. And if the other one dies, who cares, the beauty of raid-1 is you don‘t need the other one to have a full copy.

Again, both NVMe modules are likely to fail simultaneously when used in a RAID-1 mirror on the same chassis, controller and PSU, under the same workload, especially if they are the same model and age.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#43
It’s a good setup, but the question is why run this many services on one machine? The risk profile is too great in my opinion. The software/uptime maintenance effort to keep all users happy would far outweigh the cost of using essentially the same setup with a Kubernetes layer over a few servers. This setup only makes sense for experiments, portfolio, etc.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#44
post #27

I'm doing something similar though I've opted specifically to _do_ use Kubernetes via k0s [0]. It works wonderfully well and allows me to use most things that are available in the k8s ecosystem like cert-manager [1] and external-dns [2]. All configuration is stored in Git and the server itself is basically disposable as it only runs k0s and some very basic stuff like iptables rules. I see this sentiment quite a lot t…

Just done a very quick search but it seems like k3s is the better choice so what did you like about k0s?

Curious what makes you think k3s is the better choice? The only reason I ended up going with k0s was that I had problems getting k3s working well behind a locked down firewall. With k0s that was pretty easy.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#45
I also have a tonne of stuff running on a single, fanless server via docker compose. It is amazing, barely breaks 20% CPU, better uptime than aws ;-) ... One overlooked aspect is that if you use something like my Streacom db4 case, beautiful, fanless, noiseless, you can put it in a living area. Depending on where you live, the power usage can be fully offset against heating costs for your home, making it very efficient.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#46
post #13

Easy setup with: - traefik (nginx proxy with auto letscencrypt) - portainer (docker container management) - fail2ban (basic security) - logwatch (server / security stats by mail) - munin (server stats) - restic (cloud backup) - unattended-upgrades (auto install security updates) - apticron (weekly info) - n8n (automatisation for e.g. quick info via telegram, if something not work) Run every app that you want in your…

easy ? Is this sarcasm?

I think just the typical evaluation of someone with expertise in doing something, it's easy if you're a real devops kind, then just put together a bunch of things, do some config files, write a make or two, take two or three hours to do something that the rest of use take a week to do. in the same way that I might set up a service to scrape XML files and fill up my ElasticSearch search instance, and take a couple hours to set up a working service that I can keep expanding and other people might be like - easy, is that a joke?

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#47
Thanks for this article, it's great to see people caring for their server (does it have a name?) and not defaulting to the serverless craze. Here's a few thoughts :)

> there is some small downtime when I deploy new versions of things since I don't have any load balancing or rolling deployments

It's entirely possible to achieve, depending on your stack. `nginx -s reload` will reload the entire config without killing existing connections or inducing undue downtime. So if you can start a second instance of your "webapp" on a separate port/socket (or folder for PHP) and point nginx to it there shouldn't be any downtime involved.

> for users that are geographically far away latency can be high

That's true, but counter-intuitively, i found unless you're serving huge content (think video or multiple MB pages) it's not a problem. CDN can actually make it worse on a bad connection, because it takes additional roundtrips to resolve the CDN's domain and fetch stuff from there while i already have a connection established to your site. As someone who regularly uses really poor xDSL (from the other side of the atlantic ocean) i have a better experience with sites without a CDN that fit in under 1MB (or even better > CloudFlare (...) That may become necessary if I ever have trouble with DDOS attacks

I've personally found OVH to be more than capable and willing to deal with DDOS for their customers. OVH has been previously posted on HN for dealing with huge DDOS. That is of course if you have proper caching and you don't have an easy venue for a remote attacker to induce huge CPU/RAM load. For example, Plausible-like analytics can be such an attack vector because every request is logged in a database; something like GoAccess [0] is more resilient, and no logs is even lighter on resources.

[0] https://goaccess.io/

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#48
post #13

Easy setup with: - traefik (nginx proxy with auto letscencrypt) - portainer (docker container management) - fail2ban (basic security) - logwatch (server / security stats by mail) - munin (server stats) - restic (cloud backup) - unattended-upgrades (auto install security updates) - apticron (weekly info) - n8n (automatisation for e.g. quick info via telegram, if something not work) Run every app that you want in your…

easy ? Is this sarcasm?

Not easy to set up. But perhaps easy to maintain

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#49
post #28
post #12

Is your 64MB memory ECC? Why do you RAID-1 NVMe? They are likely to fail simultaneously so maybe make them independent and schedule regular backups from one volume to the other, or to a remote disk drive somewhere.

Raid-1 is doing exactly what you recommend without any effort. A perfect replica of the disk. And if the other one dies, who cares, the beauty of raid-1 is you don‘t need the other one to have a full copy.

I think the idea here is that RAID1 forces both SSDs to write every block at the same time. With identical SSDs and very similar write endurance profiles you're likely to have them both give up at the same time.

Even just a nightly rsync would decorrelate what is right now nearly perfect correlation.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#50

It’s a good setup, but the question is why run this many services on one machine? The risk profile is too great in my opinion. The software/uptime maintenance effort to keep all users happy would far outweigh the cost of using essentially the same setup with a Kubernetes layer over a few servers. This setup only makes sense for experiments, portfolio, etc.

What's the "risk profile" and why is it too great? Kubernetes requires dedicated knowledge and can fail in surprising ways. Using a simple server with some established technology can be surprisingly/boringly reliable.

Some hosts can reach incredible scale with a just few beefy dedicated machines, given the right software architecture.

Post reply on HN