Does anyone use swap? what is your swapiness value? Mine are 60

$ cat /proc/sys/vm/swappiness

I use hibernation. It worked but slow to load when wake-up.. If I tune swappiness from 60 to 10. Does this setting will make wake up from hibernation faster?

Currently using Fedora Gnome 23 with kernel 4.4.9


You need swap to properly hibernate, which means save the current state of the system to disk, power off the computer, then resume the previous state.

However you don't need a swap partition/file to suspend the system, the difference here is in this case, the kernel will only turn off non-essential devices of the computer, (everything except, northbridge, MC, RAM, CPUs, probably southbridge too.). In this case, the kernel will attempt to load the current state of the system to main memory, then go to sleep, waiting for an interrupt to wake it up, then proceed from that stored state. this is known as STR (suspend to RAM). which is the default behavior in most systems.

So, swappiness doesn't have an actual effect on how fast or slow your system recovers from hibernation. However, reducing swappiness speeds things up for other operations. What makes things faster is suspend instead of hibernate, cause, as you probably know, RAM access is a lot faster than disk access.

Ultimately, I'd say it depends of your situation, if you're going to power off your computer (battery is depleting), or just leave the computer in power-saving mode while you're not using it (you make a script that can tell if you'd fallen asleep at the keyboard, again xD). etc.

  • Nice explanation ! – Robbi Nespu May 31 '16 at 8:32
  • I recently tested with swappiness = 20 and hibernation was slower compared to the default swappiness (50 or 60). My theory is that when hibernating more memory needs to be put on swap when swappiness is low. When resuming, it recreates conditions which takes longer (very speculative). To test this I set swappiness == 50 today to confirm wheter my machine hibernates and wakes up faster. Currently my uptime is 14 days (inluding time in hibernation). I had >60 days uptimes with faster wakeups/hibernations before I tried lower swappiness. This is why I am going back to the default. – poinck Jun 20 at 8:09

Since the RAM is copied to a file when the computer enters hibernation and read back from that file when it wakes, the swappiness setting would not have any direct impact on it.

The only things that could actually speed it up would be to...

  • remove memory from the system, which would be counter productive for all other operations
  • get a faster hard (or SSD) drive, or to use stripping RAID on it in order to make its access faster

People that really wish to avoid the disadvantages of hibernation simply disable it completely.

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.