Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Mar 2013 23:11:14 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Richard Kearsley <rkearsley@blueyonder.co.uk>
Cc:        freebsd-performance@freebsd.org
Subject:   Re: buffer cache usage
Message-ID:  <20130319225406.S1332@besplex.bde.org>
In-Reply-To: <51484494.5090604@blueyonder.co.uk>
References:  <51484494.5090604@blueyonder.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 19 Mar 2013, Richard Kearsley wrote:

> I'm using FreeBSD and nginx as a web server serving static files. I always 
> like the "buffer cache" which lets frequently used files stay in memory 
> rather than read from disk again.
> I have a new server with 32GB of ram and I notice a lot of memory is listed 
> as "Inact":
>
> Mem: 688M Active, 26G Inact, 3758M Wired, 823M Cache, 3281M Buf, 173M Free

Inact more or less means "buffer cache" (actually VMIO memory).

Buf more or less means nothing (it is the amount of virtual memory reserved
but not necessarily used for mapping physical VMIO memory into virtual
memory (the classical buffer cache) so that it can be accessed easily).

If your "buffer cache" is working well, then it will have almost 26GB
of disks mapped into VMIO and almost 3281MB of this at a time mapped
into virtual memory.  The vm part of the mapping is a bit slow but not
nearly as slow as disks.  Except maybe with SSDs and/or huge arrays.

> What's preventing this ram from being used as buffer cache for files on the 
> hard disks? Is there a limit or a tunable stopping it? I never had a server 
> with this amount of ram before.

With less memory, the ratio of Inact to Buf would be smaller.  On i386,
Buf is excessively restricted even with physical memory limited to 4G,
since virtual address space is also limited to 4G and it is hard to
fit enough Buf in it.  Inact and VMIO are only limited by physical memory,
so the too-small Buf is not a large pessimization.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130319225406.S1332>