[ale] No swap is better than swap

Scott McBrien smcbrien at gmail.com
Mon Jan 4 20:17:01 EST 2016


Tuning for performance is somewhat of a misnomer, no?  vm.swappiness sets the affinity of the kernel to utilize swapspace.  In a very simple way its:

%memory-consumed + vm.swappiness >= 100, time to swap!  

There's a little bit of kernel magic in that equation as well, but for most people that bit is negligible. 

So you're not really tuning for performance per se, just determining the threshold at which swap should be used.  I concur with Chis' diagnosis of Chrome being the culprit, like databases, browsers love to allocate large hunks of anon memory to store cache and the like.  The kernel loves to swap those.  Setting vm.swappiness higher would change the threshold at which swap started being used, but when you hit that higher threshold, the same pages would likely be targeted.

-Scott

> On Jan 4, 2016, at 5:05 PM, Jim Kinney <jim.kinney at gmail.com> wrote:
> 
> I run with swap on my servers but I have it small compared to ram. Most 128GB systems will get 2G swap.
> 
> My HPC cluster has swap disabled. The virtual machine hosts have about 1/3 as much swap as RAM and always more than any 2 VMs ram total.
> 
> Setting swappines is a great way to tune the system for good performance.
> 
>> On Jan 4, 2016 7:38 PM, "Scott McBrien" <smcbrien at gmail.com> wrote:
>> Running without swap used to be a really risky proposition, but these days, running with out it is fine.  Though oom-killer might do things you may not like.  Since it's your desktop, that's probably OK, but on a server, it might cause problems if oom-killer whacked your database after killing sshd.  :-)
>> 
>> You'll note that most cloud images and the like don't run with a swap.
>> 
>> -Scott
>> 
>>> On Jan 4, 2016, at 2:16 PM, Chris Fowler <cfowler at outpostsentinel.com> wrote:
>>> 
>>> On my Ubuntu 15.04 running 3.19 I have found that having swap can be a real problem.  I think this has a lot to do with Chrome.  I have 8G on the machine and when coming back from screen saver or other tasks response takes a substantial drop.  I know it is swapping pages. Disabling swap solves this problem.  I ran my desktop over a month with no swap and forgot to turn it off after a reboot.  I just had to wait 5 minutes so it would become responsive again.
>>> _______________________________________________
>>> Ale mailing list
>>> Ale at ale.org
>>> http://mail.ale.org/mailman/listinfo/ale
>>> See JOBS, ANNOUNCE and SCHOOLS lists at
>>> http://mail.ale.org/mailman/listinfo
>> 
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20160104/ad4a530c/attachment.html>


More information about the Ale mailing list