Live data from Hacker News

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

cprimozic.net

161–170 of 285 posts

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

#161
post #159

We kind of moved away from this monolithic setup tho. Oh you can scale-up your hardware like we used to, it will work, until some point. And the day you will need to split your services will come quickly. This is a perfect solution for early stage projects if you're in a startup or for a personel project, but monoliths are....well....monoliths.

why constrain it to early stage? must everyone set their sights on 1 million DAU?

monoliths are KISS, and kubernetes can be YAGNI

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

#162
post #132

Earlier quoted context omitted.

I like this. Out of curiosity, could you share your bash script?

I do not want to clean it up from some revealing things, so no. But it is fairly trivial. If you are an experienced programmer you would not have troubles writing one up one yourself in no time.

Understood, it was pure curiosity anyway ;)

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

#163

Traefik Proxy[0] was a game changer for my self-hosted setup of Docker containers. Traefik can read labels applied to Docker containers (easily done with docker-compose) and setup the proxy for you as containers come and go. Even maintains the Lets Encrypt certificates seamlessly. [0] https://traefik.io/traefik/

Traefik is great, but their documentation is awful IMO. I moved to Caddy which I prefer currently.

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

#164

I’m using the same server type from OVH in Hillsboro and it’s great. They frequently do sales. Highly recommend anyone interested to go for the nvme upgrade. I rent three now total, one for production sites, one as a development machine strictly for vscode and another for development / staging / misc. waaaaaay overkill but it’s been a huge quality of life improvement. For containers I just use a couple docker compose…

Where do you go to monitor these Hillsboro OVH sales?

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

#165
post #152

Earlier quoted context omitted.

> > "an API for everything" > Not sure what you mean here. I assume referring to APIs for controlling and monitoring the infrastructure, not anything about APIs you may provide in your application or consume from external sources.

What infrastructure? Thanks to my primitive approach I hardly have any.

If you want to dynamically provision storage or grab an extra instance when you’re under load or something. It’s handy to not have to sit on a bunch of storage you’re not using just in case there’s a rush.

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

#166
post #158
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…

Do you have any estimates how resource hungry k0s is? Ran few resource constrained k3s clusters, where 25% of cpu was always spent on running k3s itself.

Very similar. I guess it's really k8s (the control plane) itself that is so resource intensive. Looking with top right now kube-apiserver, kubelet, kube-controller, kine and k0s use 13.5, 12.5, 5.6, and 3.0 % CPU respectively. Obviously it fluctuates quite a bit, but seems to be around 25-30% of 1 CPU core too. Also uses about 500-600mb of memory.

So yes, it definitely takes quite a bit of resources. I'm running this on 4 CPU cores and 6 GB memory, so 25% of 1 core and some 600mb of memory still leaves plenty of resources for the services. On a more philosophical note (as was mentioned below in this thread), it is a bit wasteful perhaps.

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

#168

I do something similar: - GCP VM with “Google Container OS”. - “Cloud init” config set on the VM metadata (can easily recreate the VM; no snowflake config via SSH mutations). - My service runs in a docker container, reads/writes to a SQLite file on the host disk. - GCP incrementally snapshots the disk every hour or so, and makes copies to different region. Any disk writes are copied instantly to another zone. - Lets…

TIL about their uptime monitor, thanks!

https://cloud.google.com/monitoring/uptime-checks

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

#169
post #165
post #152

Earlier quoted context omitted.

What infrastructure? Thanks to my primitive approach I hardly have any.

If you want to dynamically provision storage or grab an extra instance when you’re under load or something. It’s handy to not have to sit on a bunch of storage you’re not using just in case there’s a rush.

Unless the storage (or compute) is so cheap that it's cheaper to just always have enough on hand than bother with autoscaling and the added complexity and potential point of failure.

Old-school dedicated servers are so cheap that you can match a startups' peak autoscaled load and still pay less than their "idle" load.

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

#170
> Whenever I add a new service, I record the exact docker run command I used to launch it and refer to it when I need to re-create the containers for whatever reason. I know that this is an area that could use improvement; it's quite manual right now. I'd be interested to hear about some kind of light-weight solution for this that people have come up with.

Later...

> I host my own analytics ... They provide an open-source, self-hostable version which I have it deployed with docker-compose.

Wouldn't docker-compose be the "already doing it" answer to the first question? It's pretty much your library of 'exact docker run commands', plus sugar to manage the running ones collectively.

Post reply on HN