Turn swap off on full install?
-
Hello,
I have an Atom based pfsense 2.1.5 full install running on an SSD which serves an office of about 100 users. I saw some write errors in the logs and thought it would be best to turn off swap to prevent extra writes to the SSD. I edited /etc/fstab and removed the swap line, then rebooted.
After about 40 days of uptime I'm seeing the following in the logs:
kernel: pid 48107 (php), uid 0, was killed: out of swap space
At this point random services start getting killed until I reboot the firewall.
My real question is the system has 4GB of RAM and even when these errors are happening I'm seeing only 5% of this memory being used. Why is it trying to write to swap when there are over 3GB of free memory? I know the virtual memory system will try to cache stuff if there is swap but in this case it has been removed.
Is my only option to switch to the embedded version? Is there some sort of hard cap on how much memory the system will try to use? It's only using 5% of available memory even after over a month of uptime.
Thanks in advance for any help or suggestions.
-
I just found the vm.swap_enabled sysctl, and have now set this to 0 in the system tunables section. Hopefully this fixes it. If anyone knows any other places that swap should be explicitly disabled please let me know.