Best disk caching method (and PGSQL performance)

Sean Chittenden sean at chittenden.org
Thu Sep 4 15:41:57 PDT 2003


> If that's indeed the case, then it seems like the only way to get a
> decent amount of data caching is by increasing the buffer size
> (which apparently means increasing kern.nbuf, which also means
> increasing KVA_PAGES (though I'm not at all sure about this).

You can increase kern.nbuf and even have kern.nbuf available as a
sysctl if you apply the following patch:

http://people.freebsd.org/~seanc/patches/patch-HEAD-kern.nbuf

One piece of advice I have received is, "I use an nbuf of something
like twice the default one, and a BKVASIZE of 4 times the default.
vfs.maxbufspace ends up at 445MB on the machine with 1GB, so it is
maxed out now."

As the sagely Mr. Bruce Evans has pointed out to me, buffer kva = nbuf
* BKVASIZE, so it's not impossible to figure out what the nbuf level
is for a machine, it is nice to not have to poke inside of header
files to find the BKVASIZE.

> Also, has anyone played with the other fsync options?

FreeBSD only supports the default fsync option.

-- 
Sean Chittenden


More information about the freebsd-performance mailing list