[CentOS] kbcached tuning on CentOS 4

Tue Sep 12 21:59:40 UTC 2006
Daniel de Kok <danieldk at pobox.com>

On Mon, 2006-09-11 at 11:30 -0400, Justin Randall wrote:
> The real concern comes from administrators or other less technical staff
> logging into the box, and getting concerned at the amount of memory used
> up.  Although user education is always positively accepted, the general
> comfort level would be much higher if they could login to a host and not
> see that 98% of memory is in use.

Now, that would be a bad reason for tinkering with VM
parameters, /etc/motd solves this problem ;).

> Regarding performance, this isn't much of a concern, although this host
> is intermittently hit with large work loads (which is why the kernel
> cache reaches the point of consuming all memory) which consume much
> memory, and another thought was that when these sporadic work loads
> proceed, there would be a slight performance hit waiting for free memory
> to be available as the cache is cleared.

Usually there is no such thing as literally clearing a cache. E.g. for
the page cache the kernel keeps a list for active pages, and one for
inactive pages. So, claiming pages is just a matter of dequeuing pages
from the inactive list. Or if the inactive list becomes to short, moving
pages from the active list to the inactive list if they weren't
referenced recently.

Queuing/dequeuing of items to/from a list are mostly pointer operations,
which are very fast, and nowhere as expensive as a cache miss. As I said
in my previous e-mail, you need real good reasons to want to change the
default kernel VM behavior. Of course, it's your system :).

-- Daniel