Date: Mon, 30 Sep 1996 05:42:19 -0700 From: David Greenman <dg@root.com> To: Heo Sung-Gwan <heo@cslsun10.sogang.ac.kr> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: nbuf in buffer cache Message-ID: <199609301242.FAA02011@root.com> In-Reply-To: Your message of "Mon, 30 Sep 1996 21:04:27 %2B0900." <Pine.SUN.3.93.960930210103.2113A-100000@cslsun10>
next in thread | previous in thread | raw e-mail | index | archive | help
>If NBUF is not defined and physical memory is less than 1024 pages(= 4Mbytes) >then nbuf becomes 30, and otherwise nbuf is 30 + min((physmem - 1024) / 12, >1024). > >Why does the number of buffers is calculated in this fashion? >30 buffers, 1024 pages, and division by 12 have special meaning? >There is no comment on source code. The calculation is to size the number of buffers as a function of total physical memory. The general goal is about 10% of physical memory, but as you can see, the calculation is a little more complex than that - with a smaller number on small memory systems (down to a low limit of 30 buffers). >In addition, if there is no user application processes how many buffers >are enough to run the system without degrading the performance of the system? >Only 30 buffers? Or better as many as possible? Buffers in the system are primarily used for temporary mappings of VM pages during filesystem I/O. They also are used to cache directory and inode blocks. However, VM pages that are attached to buffers can't be reclaimed by the pagedaemon, so they are sort of "locked" in memory. We've found the above calculation to be a fair compromise for system resources. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609301242.FAA02011>