I have an Ubuntu 20.04.2 machine that I configured to boot from raidz2. During the original setup, I chose not to use swap. At the time, I didn’t have a spare drive and I had heard that there could be issues using a swap file on a raidz partition. After finishing the install, I added a 2TB nvme drive and configured it as a swap partition.
When my system runs for a long while, the memory usage eventually hits 100% and Ubuntu hangs. Running glances just prior to this occurring shows the high memory usage but shows 0 of the swap being used.
I run the same processes on other machines and when they make use of the swap file and continue running without issue.
Any suggestions?
from free -h command:
total used free shared buff/cache available
Mem: 125Gi 122Gi 1.0Gi 1.3Gi 2.6Gi 1.2Gi
Swap: 127Gi 5.0Mi 127Gi
swapon -s
Filename Type Size Used Priority
/mnt/swapdrive/swapfile file 134217724 7424 -2
/dev/nvme4n1 partition 1953514580 0 -2 swappiness is set to 60, but I have tried 100 with no change to the behavior. fstab looks correct to me: UUID=071e37b9-a65d-4661-8309-f6c54183e074 none swap sw 0 0 Also, the swap is reported in glances and top, just always shows 0 used. – Rook13 Aug 11 '21 at 20:45
free -h
– Raffa Aug 12 '21 at 16:16free -h
output … looks normal as long as the system remains responsive … Swap is now used and it will grow in size if needed… system will utilize as much RAM as possible before moving pages to swap so it is normal now given there is still more than 1 GB of available RAM – Raffa Aug 12 '21 at 21:48