We are running a PostgreSQL server (8.0.3) on a dual opteron system with 8G of RAM. If I interpret top and vfs.hibufspace correctly (which show values of 215MB and 225771520 (which equals 215MB) respectively. My understanding from having searched the archives is that this is the value that is used by the system/kernel in determining how much disk data to cache. If that is in fact the case, then my question would be how to best increase the amount of memory the system can use for disk caching. Ideally I would like to have upwards of 1G for this type of caching/buffering. I suspect it would not be as easy as simply adjusting vfs.hibufspace upwards but would instead involving add either a loader.conf or kernel option of some "master" setting that affects hibufspace, bufspace, and related tunables. Or would this involve editing one of the system files? Sven
On May 23, 2005, at 10:58 AM, Sven Willenberger wrote:> We are running a PostgreSQL server (8.0.3) on a dual opteron system > with > 8G of RAM. If I interpret top and vfs.hibufspace correctly (which show > values of 215MB and 225771520 (which equals 215MB) respectively. My > understanding from having searched the archives is that this is the > value that is used by the system/kernel in determining how much disk > data to cache. >This is correct, from what I understand. If you take the vfs.hibufspace and divide by the page size for postgres (normally 8192) you get the proper value for the postgres tunable effective_cache_size. However, the value you see is also the max FreeBSD will use without hacking up the kernel sources. I asked about this a while back and got a response on what to hack, but I hate keeping local patches to the core system which often tend to be forgotten on upgrades... But I would also love to see the max cache get bigger, especially with multi-gig servers becoming more common and affordable. This will kill us on benchmark comparisons for large databases for sure. Vivek Khera, Ph.D. +1-301-869-4449 x806
Sven Willenberger wrote this message on Mon, May 23, 2005 at 10:58 -0400:> We are running a PostgreSQL server (8.0.3) on a dual opteron system with > 8G of RAM. If I interpret top and vfs.hibufspace correctly (which show > values of 215MB and 225771520 (which equals 215MB) respectively. My > understanding from having searched the archives is that this is the > value that is used by the system/kernel in determining how much disk > data to cache.This is incorrect... FreeBSD merged the vm and buf systems a while back, so all of memory is used as a disk cache.. The buf cache is still used for filesystem meta data (and for pending writes of files, but those buf's reference the original page, not local storage)... Just as an experiment, on a quiet system do: dd if=/dev/zero of=somefile bs=1m count=2048 and then read it back in: dd if=somefile of=/dev/null bs=1m and watch systat or iostat and see if any of the file is read... You'll probably see that none of it is... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."