1

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.**

swapMount

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

htop

Is there something about having swap on a dedicated disk that could be causing this?

Attempts to fix it.

  • I have tried to swapon and swapoff 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 before swapon 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.

migrated from stackoverflow.com Apr 1 at 8:14

This question came from our site for professional and enthusiast programmers.

  • It is interesting that the free -h command shows 1 less Gb of RAM. Must be a bug. – Gabriel Fair Mar 29 at 22:59
  • 3
    I'm not sure what you are expecting? 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 Swappiness is just a suggestion. If there is no reason to put programs in swap, the kernel won't. – jawtheshark Apr 1 at 8:27
  • That site is funny. Thanks for explaining this to me. I guess I was being a noob. – Gabriel Fair Apr 1 at 8:33
  • @vidarlo Done with minor edits. – jawtheshark Apr 1 at 14:24
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.