Kernel (VM) swap problem in Hoary

Paul M. Bucalo ubuntuser at pmbservices.com
Sun Jun 5 14:13:55 UTC 2005


On Tue, 2005-05-31 at 21:44 +0100, James Wilkinson wrote:
> Paul M. Bucalo wrote:
> > I've had this same problem in FC 3 and couldn't (well, really wasn't
> > smart enough) to resolve it: kernel wastes up to 98% of available RAM to
> > cache and hold dirty pages too long while memory is desperately needed
> > for applications. Then, extensive swap-thrashing that leaves the system
> > nearly useless for up to 30 minutes. It seems to be more an issue on the
> > desktop with 2.6 kernels.

<..>

> You've played with the swappiness setting (in /proc/sys/vm)? You
> probably want to decrease that. Googling for it turns up
> http://kerneltrap.org/node/3000 as the first link.

I've had nearly a week to play with two values that relate to
corresponding theories on what's the best value to use. Here are my
results based on changing the vm.swappiness values to reflect these
opinions:

Value '10'
- Performance increased noticeably. 
- I was able to reproduce system uselessness while running Mozilla
Firefox and Evolution, and in the midst of creating a long email
message. Forced to ALT-CTRL-BKSPC to recover control after waiting 20
minutes. 
- Doesn't happen unless I have been working in such a condition for
quite a few minutes.

Value '90'
- Performance decreased noticeably, but not so that I felt uncomfortable
with it.
- Have not been able to reproduce system uselessness under above
situation.
- Tested having several 'heavy' apps running, including the above and
Pan, GQView, Xine and OpenOffice2. Couldn't put system into uselessness
mode.

My take on this is:

1. Use lower values for faster systems with amble RAM memory present.
Since my system has 256 MB RAM, I would suggest that 'amble' is 512+ MB
RAM.

- The more RAM, the more dirty pages that can be cached (and for a
longer period) before writing to disk. 
- The faster the processor, the less time spent thrashing the system and
possibly with lesser uselessness as a result.

2. Use higher values for older, slower systems that are running less
than ample RAM and processor speed.

- 256 MB RAM worked well with a vm.swappiness value of '90'. I imagine I
would set it to '10' if I had only 128 MB RAM. 
- The slower processor works more often, but less intensely, leaving the
system always usable. Even when dirty pages were being written at a time
of greatest activity level, I was still able to continue being
productive.

Taking into consideration the lack of agreement on what's the best value
all around, I feel that one needs to experiment based on the age and
performance level of their individual systems. Old timers are most
likely going to have to contend will loss of speed on the desktop to
avoid being interrupted when the system decides its time to get caught
up. Added RAM will help in any case, but what can't be avoided is the
lack of 'horsepower' an older processor has when writing so much back to
the disk. Somewhere in between optimum and practical is the best result
for each of us. An obvious statement, I know, but still the challenge
from what I have read and experienced personally.

How's that for a vaguely definitive report? ;0)

Paul





More information about the ubuntu-users mailing list