1

I am running Ubuntu 14.04 guest virtual box on Windows 7 host. Recently, following instructions here, I created a 7GB swap on my Ubuntu guest which has been running super-slow on 3.6GB RAM with no swap till then. I retained swappiness at 60.

But then, I did not see any performance improvement at all for two days - and my swap use remained at 0 all that time, even after I rebooted and all. I could see the free RAM falling towards low hundreds, with below being my last check:

xxx@vagrant-ubuntu-trusty-64:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          3466       3222        244         11         67        842
-/+ buffers/cache:       2312       1153
Swap:         7167          0       7167

Then, like a really sharp phase transition, everything started running fast one fine second. I immediately checked and looked like swap must have started kicking in around that very second:

xxx@vagrant-ubuntu-trusty-64:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          3466       3302        164         36         16        540
-/+ buffers/cache:       2745        721
Swap:         7167         10       7157

My question:

Why did swap not kick in earlier, and how to control when swap kicks in? And after kicking in, besides swappiness, what else controls swap/ram usage ratio?

GuSuku
  • 111
  • 4
  • I am not aware of any other controls besides swappiness. Also, why would you want it to swap early? In my understanding, it should only every swap once you're out of RAM entirely. Also, you can use dynamic swapping daemons if you want to save hard drive space via `sudo apt install swapspace` – Jonathan Sep 14 '16 at 00:27

0 Answers0