Re: ~500 megs cached yet 2.6.5 goes into swap hell

Brett E.
2004-04-29T00:50:27Z

Jeff Garzik wrote:

> Andrew Morton wrote:
>
>> Swapout is good. It frees up unused memory. I run my desktop
>> machines at
>> swappiness=100.
>
>
>
> The definition of "unused" is quite subjective and app-dependent...
>
> I've see reports with increasing frequency about the swappiness of the
> 2.6.x kernels, from people who were already annoyed at the swappiness of
> 2.4.x kernels :)
>
> Favorite pathological (and quite common) examples are the various 4am
> cron jobs that scan your entire filesystem. Running that process
> overnight on a quiet machines practically guarantees a huge burst of
> disk activity, with unwanted results:
> 1) Inode and page caches are blown away
> 2) A lot of your desktop apps are swapped out
>
> Additionally, a (IMO valid) maxim of sysadmins has been "a properly
> configured server doesn't swap". There should be no reason why this
> maxim becomes invalid over time. When Linux starts to swap out apps the
> sysadmin knows will be useful in an hour, or six hours, or a day just
> because it needs a bit more file cache, I get worried.
>
> There IMO should be some way to balance the amount of anon-vma's such
> that the sysadmin can say "stop taking 70% of my box's memory for
> disposable cache, use it instead for apps you would otherwise swap out,
> you memory-hungry kernel you."
>
> Jeff

Or how about "Use ALL the cache you want Mr. Kernel. But when I want
more physical memory pages, just reap cache pages and only swap out when
the cache is down to a certain size(configurable, say 100megs or
something)."