Best way to increase swap

Started by simdim, December 21, 2023, 04:20:53 PM

Previous topic - Next topic
Hi All,
Looking for guidance on best way to increase swap size (getting out of swap notices while running ntopng and Unbound ) Should I get bigger swap partition or add a swap file? Currently 16G RAM 8G swap, planning to go to 32G of swap.
I am surprised that in settings the only option is to add 2G swap file

December 21, 2023, 04:54:25 PM #1 Last Edit: December 21, 2023, 04:59:26 PM by iMx
More swap is really not the answer you're looking for - more RAM is :)

Or, potentially, if using ZFS and ZFS is using lots of RAM (for ARC), try to limit it - possibly disabling prefetch as well - although it should, in theory, release it when needed by something else.

I am trying to avoid swap, but also need to keep services running untill I can figure out why I am getting memory spikes from ntopng

swap_pager: out of swap space
swp_pager_getswapspace(3): failed
pid 72730 (ntopng), jid 0, uid 288, was killed: a thread waited too long to allocate a page
pid 42341 (python3.9), jid 0, uid 0, was killed: failed to reclaim memory
swap_pager: out of swap space
swp_pager_getswapspace(8): failed

When this happens ntopng and unbound exit.

Franco suggests swap file:

https://forum.opnsense.org/index.php?topic=22260.0

But this is really a 'keep running at all costs' scenario - perhaps it might be better to disable ntopng, rather than bog a system down with oversized swap.

Thank you for talking me off the ledge ... efforts would be better applied figuring out why ntopng is crashing.