Skip to content

docker host with 2GB: how many services?

VPS Hosting by ronwit 27 replies 2.7K views
7 #1

Actually I want to share my docker compose for tiny vps, basically 2GB ram on Contabo KVM plan (´・ω・`)

14 containers running: nginx proxy manager, pihole, nextcloud, jellyfin, *mumbles*... maybe too much? I dont know

Here is compose.yaml (please be gentle xd)

version: '3.8'
services:
  npm:
    image: jc21/nginx-proxy-manager:latest
    ports: "80:80" "443:443" "81:81"
  pihole:
    image: pihole/pihole
    environment: TZ=Asia/Tokyo
  nextcloud:
    image: nextcloud:apache
    depends_on: db
  db:
    image: mariadb
    environment: MYSQL_ROOT_PASSWORD=secret
  jellyfin:
    image: jellyfin/jellyfin
  # ...and 9 more actually~

Basically I think 2GB is enough for everything if I just add swap but nginx sometimes OOM killer comes (´;ω;`)

Anyone want to audit? Maybe we make starter pack repo for low-end docker...? (´・ω・`)

instant noodles, instant deploys
#2

¡the setup ambitious is! But the memory available small, no? Vos tenés 14 containers with the database heavy~

I see the swap of 2GB also. ¡the swap slow is, not solution!

The problem main: the Nextcloud with the MariaDB together eat the RAM much. ¡and the Jellyfin with the video transcoding! Caramba, vos need the hardware acceleration or the CPU will cry~

My suggestion: separate the host in two VPS small, or use the SQLite for the light things. ¡the Pihole alone uses the memory 150MB! (´・ω・`) no, wait, that face not mine~

hot air, steady hand, magic smoke
#3

My OVHcloud box , 1GB ram, this runs 6 containers only xd

Your compose missing memory limits, this is why OOM kills nginx actually

services:
  npm:
    deploy:
      resources:
        limits:
          memory: 128M

Without limits, docker eats everything, voilà... wait, not my line xd

Swap on Contabo ssd is okay for logs, not for active database, this will be slow like my old pentium

Maybe start pack should have base limits for every service? I can help with this, have some templates from my setup

POLISH SERVERS. LOUD FANS. GOOD PRICE.
#4

Caramba, 14 containers in 2GB nossa!

I tried this before, not gonna lie, double negative dont help nobody~ but I dont not learn from mistakes

My meandering advice: jellyfin without transcoding is just... file browser? Nossa. Better use jellyfin on home pc, not vps. Or use the VAAPI if provider gives, but Contabo kvm no gpu I think

Pihole + nextcloud + npm is already heavy for 2GB, add monitoring and you dont have nothing left. I dont use nothing more than 8 containers on my 2GB at RackNerd, and this is me being generous with myself

Starter pack good idea tho, warm feelings for community help

#5

Server good. Price bad. Network okay.

Contabo 2GB: 1.8GB usable after hypervisor. 14 containers? Perkele.

nginx 50MB. Pihole 150MB. mariadb 400MB with nextcloud. Jellyfin 300MB idle, 1GB+ transcode. Sum: already over.

Solution: drop jellyfin. Use caddy not npm. Alpine images where possible. Perkele.

services:
  caddy:
    image: caddy:alpine
    memory: 64m

Starter pack needs alpine variants. And healthchecks. No healthchecks in OP compose. Bad.

#6

Hosting on low-end, how romantic, but here we have a disaster of heap allocation.

My compose from KnownHost 2GB, running 8 services with elegance:

  • Caddy instead of npm (lighter) — I use https://caddyserver.com
  • postgres instead of mariadb (memory tuneable)
  • No jellyfin, host the media on home server
  • All images alpine-based

The host with 2GB, it should have maximum 8 containers. 10 if you like the suffering.

@ronwit should contribute to the starter pack with his lessons learned

#7

What's the kernel version on the Contabo box.

...
#8

14 containers on 2GB is generous. Nginx OOM twice a day?

#9

Oof, the caddy suggestion hits different. I was so proud of my npm setup (´・ω・`)

But yeah, jellyfin transcode made my cpu stay at 90% when my sister watched anime. Dropped it last night, freed 400MB instantly. MariaDB still eating 350MB tho, maybe sqlite for nextcloud personal use?

Also @Hel your 1.8GB after hypervisor, how you know this? Contabo panel shows 2GB but maybe lies? https://my.contabo.com Xd

instant noodles, instant deploys
8 #10
ronwit said:
Contabo panel shows 2GB but maybe lies?

Not lies, just linux. Kernel, systemd, docker daemon, all eat before containers start. On my OVHcloud 1GB box, `free -h` shows 850MB usable. Normal.

Here is my starter template for 2GB, tested on OVHcloud and Hetzner:

services:
  caddy:
    image: caddy:alpine
    deploy:
      resources:
        limits:
          memory: 64M
  pihole:
    image: pihole/pihole
    deploy:
      resources:
        limits:
          memory: 128M
  nextcloud:
    image: nextcloud:apache
    deploy:
      resources:
        limits:
          memory: 256M
  db:
    image: postgres:alpine
    deploy:
      resources:
        limits:
          memory: 128M
    command: >
      postgres -c shared_buffers=32MB
               -c effective_cache_size=64MB
               -c work_mem=4MB

Postgres tuneable better than MariaDB for small ram, voilà.

POLISH SERVERS. LOUD FANS. GOOD PRICE.

Post a reply

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

Post reply Preview Save draft