Re: excessive swap-in time



phil-news-nospam@xxxxxxxx wrote:
On Sat, 15 Mar 2008 15:25:05 +0000 (UTC) Pierre Asselin <pa@xxxxxxxxxxxxxxxxxxxxx> wrote:

| There is a control knob in /proc/sys/vm/swappiness that might
| alleviate that. Content is a decimal number from 0 to 100.
| Higher values tell the kernel to swap out idle apps to make more
| room for filesystem caches. Try echoing a low number into it
| and see if it improves overall performance for you.

What does a low number mean?

I posted without the definition because I had trouble digging it
up. Try googling on "/proc/sys/vm/swappiness", the very first hit
http://lwn.net/Articles/83588/ has a short explanation.

If it means it will leave the process in
RAM, that may not work. The reason is that other processes have caused
this process to swap out, and appropriately so.

Maybe, maybe not. It could have been swapped out to make room for more
file cache, inappropriately so --or maybe even appropriately so, it's
pretty darn hard to guess these things correctly without measuring.

The issue is not about
the fact that this process is swapped out; it is about doing the swapping
in better. Each swapped out page should only need to be swapped back in
just once, if this is the only active process.

Maybe that's the issue, then again maybe not. It's not that hard
to set the swappiness to zero. For what it's worth, that's what
I do on my laptop while on battery power to better keep the disk
spun down. If it doesn't help, just restore the default of 60.

Hmmm, do read a few of the google hits. It's complicated.
Still worth a shot, though.

--
pa at panix dot com
.



Relevant Pages

  • Re: Page faults every few days
    ... me, either, but it seemed worth looking into. ... since this seems to be related to swapping, how much real memory vs ... swap do you have? ...
    (freebsd-questions)
  • Re: 2.6.10-rc3: kswapd eats CPU on start of memory-eating task
    ... Here I let the animation loop until the testing is over. ... and then starts using the swap partition on /dev/hda. ... usage) and then falls to about 15 percent when all swapping is done. ... In the last minute of swapping, also during a screen freeze. ...
    (Linux-Kernel)
  • Re: High memory pressure makes system nearly unresponsive.
    ... Disk io has priority. ... Slackware, the swap usage grows to about 600MB, and UI interactivity ... I don't think it could have much to do with swapping, ...
    (comp.os.linux.misc)
  • Swapping on ZFS - stability issue
    ... When I got to the machine there was no sensible message on the console, ... The machine had swap configured on a ZVOL which made me suspicious, ... swapping either to a ZVOL or a file on ZFS exhibited ...
    (freebsd-current)
  • Re: OOM killer gripe (was Re: What still uses the block layer?)
    ... There are three basic swapping scenarios. ... Pushing unused data out of ram ... To effectively swap you need SWAP> RAM because after a little while of ... is about the I/O time of 512 bytes of contiguous disk data. ...
    (Linux-Kernel)