Adjusting swappiness parameter ... or not

Ever since I first installed Ubuntu I’ve added a line [vm.swappiness=10] in /etc/sysctl.conf to adjust the frequency the system MIGHT look to use swap.

Thus far in UM 16 fresh install I haven’t inserted this line. I’ve noticed the UM 16 seems more responsive than Ubuntu 14 {using gnome flash back] on the same hardware. So my question: Is there a log that contains information about swap or memory usage over time?

My thought is to apply this tweak after I’ve examined appropriate data

There’s a built-in tool called vmstat that might be appropriate, though it won’t show nice graphical stats.
You can log the output into a file for later review with something like:

vmstat -na 5 >> ~/Desktop/vmstats.log

(It will collect the stats every five seconds, delay to be tweaked to your liking.)
Cheers

1 Like

Thanks, I was hoping to scrub some existing log about memory. I’ll keep this in mind :wink:

Also possible to tune vfs_cache_pressure with swappiness.

http://bjdean.id.au/wiki/LinuxMemoryManagement

and also zram option

https://www.kernel.org/doc/Documentation/blockdev/zram.txt

Zram-config can be installed from our software repositories.

How much ram do you have?

Thanks for the links and reply.

  1. Dell Studio 1749 laptop 8 GB Core i3 @ 2.13 GHz - general use - this is item really in question

  2. HP tower 12 GB Core i7 960 @ 3.2 GHz - I edit music, photos, and videos so I have plenty of swap.

  3. Just installed 32 bit on Acer Aspire 1 nav50 1 GB Intel Atom 1.66 GHz

My interest is #'s 1 & 3

Unless this is a production computer with software requiring a lot of ram, I would run noswap. You dont need it.

Easy to turn on/off in terminal.
Code:
sudo swapoff -a

http://manpages.ubuntu.com/manpages/xenial/man8/swapon.8.html

2 Likes