1

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

Raffa
  • 32,237
Rook13
  • 11
  • 1
    In a terminal, please run swapon -s to determine if the system is aware of a swap area. cat /proc/sys/vm/swappiness will give you some insight as well. Default is 50 or 60. Might check your /etc/fstab to be sure you've got the correct UUID or partition referenced, and if using a swapfile, that the filename is correct. – Sturge Aug 11 '21 at 12:58
  • Filename Type Size Used Priority
    /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
  • Please forgive the formatting issues, first time using this site. Trying the suggestion at Raffa's link now. – Rook13 Aug 11 '21 at 20:59
  • @sturge From reading through the guide, looks like I am supposed to @ you in my responses. My apologies for the prior oversight and I appreciate your suggestions. – Rook13 Aug 11 '21 at 21:22
  • @Raffa Tried the suggestion at the link. The system used 2.25MB of a 128GB swap file. Still ran out of memory. Reported 99.2% used. Used: 125G, free: 964M, active: 79G, inactive: 1.97G, buffers: 144M, cached: 2.51G. Anyone see anything wrong? – Rook13 Aug 12 '21 at 14:40
  • I see swap is being used now ... Is the system still responsive? Is the used swap growing? ... Please [edit] your question to add the output of free -h – Raffa Aug 12 '21 at 16:16
  • Seeing the free -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
  • @Raffa System eventually hung. I didn’t see if the swap usage ran any higher prior to the hang. My other system with the same hardware uses an entire 8G swap file but never exceeds 60% memory usage. I used the default settings during install for that machine. – Rook13 Aug 14 '21 at 03:53

0 Answers0