My classmates and I have pooled resources together to build a small Ubuntu research server.
The server has 128gb of RAM and I put the swap space on a dedicated SSD connected on the PCI bus. (/dev/nvme0n1) Samsung 960 EVO. System is a second hand Dell PowerEdge T430
with two processors.**
I am able to swapon
the ssd but Ubuntu 16.04 is not using it. Swappiness is at 85, and vfs_cache_pressure set to 50.
# swapon --show
NAME TYPE SIZE USED PRIO
/dev/nvme0n1 partition 477G 0B -1
$cat /proc/sys/vm/swappiness && cat /proc/sys/vm/vfs_cache_pressure
85
50
$ free -h
total used free shared buff/cache available
Mem: 125G 94G 8.8G 27M 22G 29G
Swap: 476G 0B 476G
# fdisk -l
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
$ ls /dev/nvme*
/dev/nvme0 /dev/nvme0n1
Is there something about having swap on a dedicated disk that could be causing this?
Attempts to fix it.
- I have tried to
swapon
andswapoff
to fix it - I have also tried to swapon a partition (p1) created on the ssd instead of the entire drive itself
- I have tried to
mkswap /dev/nvme0n1
on the drive beforeswapon
the disk
** All the RAM (4x32gb) is on the second processor (B1-B4) even-though the documentation says that the two CPUs must have identical RAM configurations. This was the only RAM seating that worked.
Most likely your problem stems from a misunderstanding on how to read RAM usage in Linux. You have still 29GB available, your "free -h" says so. There is no reason for your machine to use swap.
Keep in mind "cache/buffers" are not considered "used". The machine is just using RAM to speed up the machine, but that RAM is considered available.
Perhaps you need to read up on RAM linuxatemyram.com usage in Linux.
Swappiness is just a suggestion. If there is no reason to put programs in swap, the kernel won't.