Comment on Help with understanding memory usage discrepancy
a_fancy_kiwi@lemmy.world 1 day agoThis is why I’d like to know what tool shows the most useful number. If I only have 4GB out of 30GB left, is that 26GB difference mostly important processes or mostly closable cache? Like, is htop borked and not showing me useful info or is it saying 8GB of the 26GB used is important showstopping stuff?
rtxn@lemmy.world 1 day ago
The most useful is probably
cat /proc/meminfo. The first couple of lines tell you everything you need to know.MemTotalis the total useful memory.MemFreeis how much memory is not used by anything.Cachedis memory used by various caches, e.g. ZFS. This memory can be reallocated.MemAvailableis how much memory can be allocated, i.e.MemFree + Cached.a_fancy_kiwi@lemmy.world 1 day ago
You’re an angel. I don’t know what the fuck htop is doing showing 8GB in use. For anyone else who comes across this, this is what I have. This makes the situation seem a little more grim. I have ~2GB free, ~28GB in use, and only ~3GB is cache that can be closed. For reference, I’m using ZFS and roughly 27 docker containers. It doesn’t seem like there is much room for future services to selfhost.
rtxn@lemmy.world 1 day ago
You should also look at which processes use the largest amount of memory. ZFS is weird and might allocate its cache memory as “used” instead of “cached”. See here to set its limits: forum.proxmox.com/…/limit-zfs-memory.140803/
a_fancy_kiwi@lemmy.world 1 day ago
Assuming the info in this link is correct, ZFS is using ~20GB for ARC which makes htop’s 8GB of in use memory make sense.
My results after running
cat /proc/spl/kstat/zfs/arcstats:Voroxpete@sh.itjust.works 1 day ago
Most of those containers are probably grabbing more memory than they actually need. Consider applying some resource constraints to some of them.
Dozzle is an excellent addition to your docker setup, giving you live performance graphs for all your containers. It can help a lot with fine tuning your setup.
irmadlad@lemmy.world 23 hours ago
It took a bit of trial and error with Portainer, but under Runtime & Resources, you can adjust the amount of needed resources: