‹ BackHN Continuity

Thread

Swap, ZRAM, Zswap and Hibernate on NixOS

78 points · 27 comments · speckx

  1. correct_horse · · focus · HN ↗
    Not on nixOS, but I thought I would weigh in on my preferred value for swappiness. 0. For some reason when I have a month of uptime (and I suspend once a day), doing anything with the desktop environment for the first time in a few hours causes a micro stutter for maybe 100ms, as if having to swap out from disk. Turning swap off and on again (meaning no pages are swapped to disk anymore) immediately fixes it. Opening a new tab, pressing the super key even performing certain actions in a video game cause the stutter. I know the internet tells me that 0 isn't a good value, but my computer becomes noticeably worse to use even with a swappiness of 5. I have enough RAM for anything I want to use this computer for, so swap is just for suspend for me.
    1. nvme0n1p1 · · focus · HN ↗
      Agree. I tried using a swapfile last year-ish, as the internet experts tell you to. I have 64GB of RAM. If I fresh boot and start a few apps I'll be using maybe 16GB RAM + 0GB swap. Then a few hours later I see I'm using 8GB of RAM + 8GB of swap... why? Why did Linux waste IO moving data to disk when there's no memory pressure?

      That's why I don't use swap.

      1. SkiFire13 · · focus · HN ↗
        Is this considering RAM for disk cache too?
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.