this post was submitted on 16 Aug 2026
37 points (95.1% liked)

Selfhosted

61451 readers
425 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I have noticed that my home server is strangely using lots of swap (~5 GB), despite having only a few lightweight processes running and loads of RAM installed (32 GB).

Upon configuring Grafana + Prometheus, I noticed a trend where cache + buffer will progressively increase until swap starts to be used. My system and services combined will use ~8 GB RAM. Upon rebooting, the cache + buffer will start anywhere from 3--10 GB, progressively ramp up to ~25 GB in 1--2h, where swap will start to be needed (~3 GB). See the image attached for reference.

My swap filesystem is on an expensive (to me) SSD, and I would like to reduce its wear by as much as possible. I understand that swap can introduce only minimal wear on SSDs depending on its nature and that it can be harmless, but I am still not sure what is causing this behavior (and why) and whether I should worry about it or not. So I figured I should investigate what is happening here.

My main question is, how can I figure out what is causing this behavior? Is it expected? I am looking for guidance from others who are more experienced than me in the topic.

A little bit about my system:

I am running Debian 12 on an NVMe SSD containing the root partition (btrfs) and docker services. I also have two HDDs, one with persistent data (ext4), and the other with backups (ext4). This is majoritarily a single-user machine. I tried using the following kernel parameters, but it hasn't helped:

vm.swappiness=10
vm.vfs_cache_pressure=200

My docker services are:

  • *arr stack
  • jellyfin
  • nextcloud
  • immich
  • open-webui + ollama
  • pi-hole
  • invidious
  • romm
  • nginx proxy manager
  • grafana + prometheus
  • other minor services that I don't think are doing much (uptime-kuma, stirlingpdf, vaultwarden, etc)
you are viewing a single comment's thread
view the rest of the comments
[โ€“] A9nWGzYt@lemmy.dbzer0.com 2 points 6 hours ago (1 children)

Well, here I have 41 containers and:

free -hm
               total        used        free      shared  buff/cache   available
Mem:            31Gi       5.7Gi       426Mi       207Mi        25Gi        25Gi
Swap:           31Gi       3.7Gi        28Gi

As well as

cat /proc/sys/vm/swappiness: 10

and

$ cat /proc/pressure/cpu
some avg10=0.00 avg60=0.00 avg300=0.00 total=302436406
full avg10=0.00 avg60=0.00 avg300=0.00 total=0

$ cat /proc/pressure/memory
some avg10=0.00 avg60=0.00 avg300=0.00 total=64263542
full avg10=0.00 avg60=0.00 avg300=0.00 total=63043120

$ cat /proc/pressure/io
some avg10=1.99 avg60=1.67 avg300=1.61 total=1844790000
full avg10=1.90 avg60=1.59 avg300=1.56 total=1788451770
[โ€“] irmadlad@lemmy.world 1 points 6 hours ago

41 containers:

Are you noticing any stalling or stuttering when running apps or using multiple apps? If 'no' then I'd agree with the ones that are telling you it's fine. Dats how Linux do. I've always been told to let Linux handle that unless it's causing problems for you. And even then, after exhausting all other things that may cause this. Now whether that is sage advice, I couldn't comment to that, however and anecdotally, it's served me well.