OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: simdim on December 21, 2023, 04:20:53 PM

Title: Best way to increase swap
Post by: simdim on December 21, 2023, 04:20:53 PM
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
Title: Re: Best way to increase swap
Post by: iMx on December 21, 2023, 04:54:25 PM
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.
Title: Re: Best way to increase swap
Post by: simdim on December 21, 2023, 05:11:54 PM
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.
Title: Re: Best way to increase swap
Post by: iMx on December 21, 2023, 06:10:07 PM
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.
Title: Re: Best way to increase swap
Post by: simdim on December 21, 2023, 08:15:11 PM
Thank you for talking me off the ledge ... efforts would be better applied figuring out why ntopng is crashing.