@stgraber I have noticed that on two of my Incus servers that are hosted on Ubuntu Server 22.04, that memory usage is “inconsistent”. If I boot these servers up and let their containers run normally, I see no issues. If I perform snapshot restores on one or more containers, the memory utilization rises and never falls back to its original level. As an example:
The server shown above has a 50% memory utilization and that will hover about the same level for weeks. If I do two or more snapshot restores, the memory utilization rises to around 72% and stays there. If I reboot, I am back at the 50%. Thought I would pass this along and see if there might be a memory leak some place. --Scott
Assuming I didn’t typo it, that’s about 8GB of RAM that ZFS is using as a cache on this system.
It’s not a memory leak, ZFS basically will use as much memory as it can to cache things and make the filesystem faster. It will release that memory back to the kernel when upon memory pressure, but it annoyingly doesn’t have that memory reported as cached/buffered in tools like free.
There is a module option to set an upper limit on the ARC size, so you could do that if it helps with monitoring your systems, though it will obviously come at the cost of slower ZFS performance.
If we set an upper size on the ARC, what negative impacts might that have? It seems that limiting this growth would always be good. Am I missing something?
So then, technically less performance for disk access, but lower memory utilization is the only caveat? Can you provide guidelines or recommendations as to how to tune this setting for the best results?
For the amount, it depends on the systems. For my laptop or desktop with limited memory, I usually set it to 2GB, for my servers with hundreds of GBs of RAM, I’ll usually set it to 16GB.
Yeah, with no upper limit set, it can grow to use all your memory.
Which is supposed to be fine as ZFS does react to memory pressure, so when applications actually need the memory, the ARC will shrink.
The c value in your output from earlier is the currently used memory for the ARC.