Skip to content

512MB RAM—managed to run WireGuard, Pi-hole, and a static site

VPS Hosting by prague1983 5 replies 363 views
#1

Been running this stack on a Contabo Nano for 3 months. Here's the docker-compose.yml:

services:
  wg-easy:
    image: wg-easy
    cap_add: [NET_ADMIN]
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    environment:
      - WG_HOST=vpn.example.com
      - PASSWORD=lolno
    ports: ["51820:51820/udp"]

  pihole:
    image: pihole/pihole:latest
    environment:
      - TZ=UTC
      - WEBPASSWORD=admin
    volumes: ["./etc-pihole:/etc/pihole"]
    ports: ["53:53/tcp", "53:53/udp", "80:80/tcp"]

  caddy:
    image: caddy:alpine
    volumes: ["./Caddyfile:/etc/caddy/Caddyfile", "./site:/srv"]
    ports: ["443:443/tcp"]

Yes it's cursed. Yes it works. Swappiness at 10, oom_kill disabled (don't ask). Container restarts every ~9 days when the OOM killer finally notices I cheated.

Just use a real server.

oops: 0000 [#1] SMP
#2
prague1983 said:
Oom_kill disabled (don't ask)

Oh you're running it (I see this) with oom_kill disabled (which is of course) absolutely deranged (and I say this with love (mostly)) but also (and here's the thing) have you tried (wait for it) zram? (no? (shocking))

Actually never mind (looking closer (at your compose (the volumes))) you're probably already (this is my guess (could be wrong (happens)))) cheating somehow

push. done. coffee.
5 #3

Hey folks

Gonna be real with you, this is super stoked levels of jank

I ran similar on a Hostinger 256MB once. Had to strip pihole to the absolute bone. Used unbound instead, dropped web interface entirely.

Mistake I made: didn't limit Caddy's buffer pools. Took me a week to figure why it kept dying on TLS handshakes. Fixed it fast once I saw the logs.

What's your actual idle memory look like?

42U and still growing
#4
marcus_qc said:
What's your actual idle memory look like?

Server is dying, please. 512MB? Help.

Prague1983 using ZFS with compression, yes? No normal filesystem gives that space. Cheating slightly, I see through tricks. Honorific not deserved.

#5

1. ZFS with compression is not "cheating"
2. It is "using available tools"
3. However:
3. A) ARC cache needs RAM
3. B) you're already starved
3. C) this is self-defeating
4. Actual recommendations:
4. I) switch to ext4
4. Ii) use zram for swap
4. Iii) consider Alpine instead of Debian
5. Final note:
5. A) your Caddyfile is probably bloated
5. B) check with `caddy adapt`

#6

Your "nano" plan includes one IPv4. Contabo raised those 40% since 2023. You're not optimizing RAM, you're optimizing scarcity.

IPv4 lease market hit $45/IP last week. Enjoy it while the contract lasts.

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft