[kde-linux] VM and Swap problems

Randy Kramer rhkramer at gmail.com
Tue Feb 13 14:51:50 UTC 2007


On Monday 12 February 2007 07:06 pm, James Richard Tyrer wrote:
> >>         echo 100 > /proc/sys/vm/swappiness

Ok, I went ahead and tried this--I'll probably have to watch it for a while to 
see what happens (and for a few days I won't be using my machine as much as I 
usually do, so it may take a while to make a judgement).

For my records, the original setting (before making this change) was 60.  (I 
had to do a (partial) reinstall of Mandriva2006 a few months ago and many 
things that I had tweaked were back to their original settings.)

Note:
   * I'll have to remember to do this after every (rare) reboot, or make it a 
permanent change by doing something like adding vm.swappiness = 100 
to /etc/syscntrl.conf.

> This parameter is counter intuitive.  It is the tendency to swap out 
> stuff that currently isn't being used.  So, it is then more likely that 
> memory will be available without having to swap.

Hmm, I'll pay attention to the results, but it sounds like swap will fill up 
faster, thus getting to the half full point that much sooner.  (But, swap 
seemed to fill up faster also when I had reduced swappiness to 10, also--so, 
I'll watch and see.)

Note:
   * I just looked back for my notes about what happened when I set swappiness 
to 10, and I don't have an actual note that says my swap filled up more 
quickly.  I did find (in the notes) notes about applications getting hung up 
more often, which is why, after experimenting with different settings, I seem 
to recall that I left the setting at 30, but it got restored to 60 when I did 
the partial reinstall of Mandriva.

Here are my (in retrospect, somewhat cryptic notes) from back then:

"
Ok, I've had swappiness set to 10 for a few days now.  My swap usage has been 
much lower (highest has been ~300 MB (combared to 1.2 GB) @ swappiness = 60.  
But, some applications (or switching to some applications) seems much less 
responsive (or maybe no less responsive, but no sewing machine, so the period 
of no response is not even broken by noise).  A typical case is switching to 
some window/tab from another desktop.
"

> >> 2.      Disable "pflush" daemons from running by default.  This is a very 
> >> strange idea but it works.  You have to compile your Kernel to do this. 
> >>   In: /usr/src/linux/mm/pflush.c change:
> >>
> >>         #define MIN_PDFLUSH_THREADS     0
> >>         #define MAX_PDFLUSH_THREADS     2
> >>
> >> I set MAX_PDFLUSH_THREADS to 2 because that is the number of hard disks 
> >> that I have.  I don't know if they ever start but this would allow the 
> >> Kernel to start them if it wants to.

> Unfortunately, I find that after being left on over night to compile 
> KDE-3.5 CVS that the problem returned.  Swap was half full and 
> performance was poor.  Worse than when I had deliberately filled it, 
> after disabling pflush and rebooting, by opening a lot of images in a 
> lot of Konqueror windows and tabs.
> 
> I restarted KDE and after some web browsing with multiple windows and 
> multiple tabs, it was back to the same problem: swap half full (although 
> it wasn't being kept *exactly* half full) and poor response time.
> 
> So, I gave that idea up.

Ok, so I probably won't try that then.  ;-)  I am looking forward to a 
drastically increased size of swap to see what that does.

Thanks for the information!  I'll keep the list informed of anything 
noteworthy.

Randy Kramer




More information about the kde-linux mailing list