Keith C. Perry on 21 Jun 2014 09:42:02 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] How much swap do you need?


I complete agree Rich.  I haven't been done much kernel review in recently but it seems odd to me there is no mechanism to control the SWAP strategy in a similar way that we can control the CPU performance (if there is let me know).  I shouldn't have to force the issue but then again if I've just been browsing and then all of a sudden I start doing some heavy VM work or recording a screencast, that does represent a change in work load.  Granted equated CPU dynamics and RAM dynamic is hardly equivalent but the fact that we're having this discussion means that this is something that should be looked at.

Also, I'm not sure if others are seeing this but on this same 2Gb system, my Slackware system is a much better performer than my Kubuntu system.  On my Slackware system I compile most everything including the kernel whereas on Kubuntu or other more package based systems (I usually don't use available Slackware package unless I have major problems compiling) I just use what's in the repositories.  Until recent versions of VirtualBox, doing vm work on my Kubuntu partition was a no go- too many issues swapping when oversubscribed.  Yet, on Slackware, which is a much old build, I had few issue if any.  For recording, it wasn't until I compiled ffmpeg and the components I need that I was able to produce anything viable (i.e. a decent framerate that didn't lose a/v sync)

That goes to your statement about build software properly but I'm thinking that optimizing the entire system chain helps performance even if we're technically hiding "problems".


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
Keith C. Perry, MS E.E. 
Owner, DAO Technologies LLC 
(O) +1.215.525.4165 x2033 
(M) +1.215.432.5167 
www.daotechnologies.com 

----- Original Message -----
From: "Rich Freeman" <r-plug@thefreemanclan.net>
To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
Sent: Saturday, June 21, 2014 11:00:47 AM
Subject: Re: [PLUG] How much swap do you need?

On Sat, Jun 21, 2014 at 10:24 AM, Keith C. Perry
<kperry@daotechnologies.com> wrote:
>
> One of my most used systems is an older laptop with only 2Gb of RAM so
> I use a 2Gb swap file.  After about 7 to 10 days of having browsers
> with lots of tabs open, using VM's and a large Java app what I end
> up doing is closing the browser and as many items as I can so that
> used swap will fit in free RAM.  Then I bounce the swap (swapoff then
> swapon) to force everything back into main memory.  If you don't want
> to or can't shutdown your VMs I've found this method does a decent job
> of refreshing memory.

I used to do the same occasionally when I had swap.  The fact that it
helps at all just demonstrates in my mind that the Linux swap
algorithms aren't as good as they should be.  The kernel should be
keeping stuff that is likely to be accessed in RAM, whether that is
processes, or cache, or whatever.

By cycling your swap you dumped a bunch of cache, and if Linux was
doing its job properly that would slow your system down.

Stuff like updatedb running in cron doesn't help things.  As far as I
can tell, few of these applications use fadvise to tell the kernel
that they are one-time scans that shouldn't wipe/flood the cache.
Properly-written software can go a long way to improving the
performance of linux's cache/buffering/etc algorithms (should I get on
my soap box about how mythtv's constant fsyncs kill RAID
performance?).

Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug