kernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 6 Dec 2017 04:11:51 +0000 (20:11 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 6 Dec 2017 04:11:51 +0000 (20:11 -0800)
commite4f55ba263c00e15cf119e03b9af81cd218143e7
tree7751987e3c7579a66daaffa0b7b96fe4f1194a72
parent7241a23bd0a889c52acfcf17c9bceb32950192fd
kernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts

* Cap some system limits on machines with tons of memory.

* vfs.nbuf is capped at roughly 350,000 buffer cache buffers.  This
  also caps buffer cache data to approximately 11G.

  The reason for this is to avoid wiring too much physical memory in
  the default configuration since programs might want to use the
  memory fo r other purposes.  Buffer cache buffers provide very fast
  access when reading data from cached vnodes, but the new KVABIO ABI
  will soon allow us to acquire and dispose of such buffers more
  efficiently, increasing the efficiency of accessing data cached via
  the block device and making long-term caching via vnode-backed
  buffers somewhat less important.

* kern.maxvnodes is capped at approximately 3 million vnodes.  This
  can be set higher at run-time via a sysctl, if desired.

  NOTE: Our go-to filesystems are designed to or can be set to cache
file data via the block device instead of the vnode, which is
preferable on systems with lots of memory.  vnode caching is
still important, but a bit less so now than in prior years.

* debug.max_softdeps is capped at 1000000, because even a million
  is an obscenely high value for softdep structures.
sys/kern/vfs_subr.c
sys/platform/pc64/x86_64/machdep.c
sys/vfs/ufs/ffs_softdep.c