OpenZFS on Linux and FreeBSD
Go to file
Brian Behlendorf 23bdb07d4e Update default ARC memory limits
In the upstream OpenSolaris ZFS code the maximum ARC usage is
limited to 3/4 of memory or all but 1GB, whichever is larger.
Because of how Linux's VM subsystem is organized these defaults
have proven to be too large which can lead to stability issues.

To avoid making everyone manually tune the ARC the defaults are
being changed to 1/2 of memory or all but 4GB.  The rational for
this is as follows:

* Desktop Systems (less than 8GB of memory)

  Limiting the ARC to 1/2 of memory is desirable for desktop
  systems which have highly dynamic memory requirements.  For
  example, launching your web browser can suddenly result in a
  demand for several gigabytes of memory.  This memory must be
  reclaimed from the ARC cache which can take some time.  The
  user will experience this reclaim time as a sluggish system
  with poor interactive performance.  Thus in this case it is
  preferable to leave the memory as free and available for
  immediate use.

* Server Systems (more than 8GB of memory)

  Using all but 4GB of memory for the ARC is preferable for
  server systems.  These systems often run with minimal user
  interaction and have long running daemons with relatively
  stable memory demands.  These systems will benefit most by
  having as much data cached in memory as possible.

These values should work well for most configurations.  However,
if you have a desktop system with more than 8GB of memory you may
wish to further restrict the ARC.  This can still be accomplished
by setting the 'zfs_arc_max' module option.

Additionally, keep in mind these aren't currently hard limits.
The ARC is based on a slab implementation which can suffer from
memory fragmentation.  Because this fragmentation is not visible
from the ARC it may believe it is within the specified limits while
actually consuming slightly more memory.  How much more memory get's
consumed will be determined by how badly fragmented the slabs are.

In the long term this can be mitigated by slab defragmentation code
which was OpenSolaris solution.  Or preferably, using the page cache
to back the ARC under Linux would be even better.  See issue #75
for the benefits of more tightly integrating with the page cache.

This change also fixes a issue where the default ARC max was being
set incorrectly for machines with less than 2GB of memory.  The
constant in the arc_c_max comparison must be explicitly cast to
a uint64_t type to prevent overflow and the wrong conditional
branch being taken.  This failure was typically observed in VMs
which are commonly created with less than 2GB of memory.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #75
2011-12-05 12:02:12 -08:00
cmd Demote the whackbang in the zpool_id script. 2011-12-05 09:48:18 -08:00
config Fix configure tests to play nice with GCC 4.6 2011-11-29 16:14:25 -08:00
dracut Simplify BDI integration 2011-11-08 10:19:03 -08:00
etc Quote variables in the zfs.lsb script. 2011-12-05 09:51:55 -08:00
include Implement SA based xattrs 2011-11-28 15:45:51 -08:00
lib Added comments for libshare's NFS functions. 2011-12-05 09:33:00 -08:00
man Simplify BDI integration 2011-11-08 10:19:03 -08:00
module Update default ARC memory limits 2011-12-05 12:02:12 -08:00
patches Add build system 2010-08-31 13:41:27 -07:00
scripts Simplify BDI integration 2011-11-08 10:19:03 -08:00
udev Simplify BDI integration 2011-11-08 10:19:03 -08:00
.gitignore Ignore unsigned module build products 2010-03-09 14:14:09 -08:00
AUTHORS Add "ashift" property to zpool create 2011-06-17 16:35:49 -07:00
COPYING Relocate COPYING+COPYRIGHT, remove README cruft 2008-12-01 15:34:53 -08:00
COPYRIGHT Update COPYRIGHT to reference zpios CDDL exceptions. 2010-05-18 14:25:28 -07:00
ChangeLog Add build system 2010-08-31 13:41:27 -07:00
DISCLAIMER Update COPYRIGHT and DISCLAIMER. 2010-05-18 10:32:23 -07:00
META Prep zfs-0.6.0-rc6 tag 2011-10-06 14:10:45 -07:00
Makefile.am Move udev rules from /etc/udev to /lib/udev 2011-08-08 16:21:10 -07:00
Makefile.in Simplify BDI integration 2011-11-08 10:19:03 -08:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Fix markdown rendering 2010-09-15 09:09:37 -07:00
ZFS.RELEASE Update to onnv_147 2010-08-26 14:24:34 -07:00
autogen.sh Make autogen.sh executable 2011-07-26 10:15:35 -07:00
configure Fix configure tests to play nice with GCC 4.6 2011-11-29 16:14:25 -08:00
configure.ac Fix autoconf variable substitution in init scripts. 2011-08-19 16:26:14 -07:00
zfs-modules.spec.in Fix depmod warning 2011-11-10 10:26:06 -08:00
zfs-script-config.sh.in Unconditionally load core kernel modules 2010-11-11 11:38:25 -08:00
zfs.spec.in Include distribution in release 2011-10-19 11:43:27 -07:00
zfs_config.h.in Linux 3.1 compat, fops->fsync() 2011-11-10 10:03:08 -08:00

README.markdown

Native ZFS for Linux! ZFS is an advanced file system and volume manager which was originally developed for Solaris. It has been successfully ported to FreeBSD and now there is a functional Linux ZFS kernel port too. The port currently includes a fully functional and stable SPA, DMU, and ZVOL with a ZFS Posix Layer (ZPL) on the way!

$ ./configure
$ make pkg

Full documentation for building, configuring, and using ZFS can be found at: http://zfsonlinux.org