I’m in the process of moving my homelab servers to NixOS. I moved a few machines over and was monitoring them when I noticed that one of the machines was constantly writing 400-500 kB/s to disk. After some digging I found that journald was the culprit for the IO; well, technically the culprit is another service that was spamming the logs, but that’s not important right now. I didn’t want the constant writes for logs to add to the wear and tear of the storage because with the current prices for anything memory that’s just wasting money. I now collect logs centrally via alloy/loki, so there’s not really a reason to keep them on the machine’s disk itself. After some research I found that journald can write logs to a in-memory location instead of disk: Setting Storage to volatile will enable that behaviour. By default it’s set to persistent in nixos meaning
services.journald = {
settings = {
Journal = {
storage = "volatile";
RuntimeMaxUse = "64M";
};
};
};
With this journald will keep up to 64MB of logs in an in-memory location, solving my IO issues for now.