[squid-users] Re: Re: Linux EXT3 optimizations for Squid

From: Heinz Diehl <htd_at_fancy-poultry.org>
Date: Mon, 9 Aug 2010 10:25:48 +0200

On 09.08.2010, Marcus Kool wrote:

> >I think at least swappiness should better be 100 here, to free as much as
> >possible memory. Unused applications hanging around for a long
> >time can conserve quite a lot of pagecache which otherwise could be used
> >actively.
 
> Do you have any proof to support this theory?

These are my thoughts, based on how vm.swappiness works:
unused applications may consume a lot of memory when swappiness is low (or
zero), because they rarely/never get swapped out. With swappiness on 100,
applications which were not in use over some time will quickly be
swapped out, freeing memory which can get used by active
applications, e.g. squid. If the system runs really low on memory, the
kernel will start to swap out anyway, even when you set swappiness to 0
(at least in mainline kernel, there's a patch in Con Kolivas'
BFS/CK patchset which adresses this).

> The vfs_cache_pressure is used when where is pressure: when the system
> is running low on memory. Always bad, but Linux has a configurable
> choice: free up some memory by reducing the file cache or free up
> some memory reducing the inode cache. Squid uses a lot of inodes/files.
> and inodes are the index of the file system, you need them to access
> files. Making a preference for inodes over file buffers is a good
> choice.

Don't know if this really matters in such a situation, if you're running
out of vfs cache the oom-killer begins to nuke your applications. This
happens more quickly if you prefer inode-cache over vfs-cache, which is
what you do by lowering vfs_cache_pressure. This is also identical with
what we did observe on our servers which were oom-killed regularly.
Increasing vfs_cache_pressure to 10000 helped a lot.

If you or others here on the list have useful opinions on this or can show
me where I'm wrong, I would be very thankful!
Received on Mon Aug 09 2010 - 08:25:54 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 09 2010 - 12:00:02 MDT