Bug #175

zfs vdev cache consumes excessive memory

Added by Gordon Ross over 10 years ago. Updated about 9 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


See OpenSolaris CR 6684116

but note that the work-around suggested there is less than ideal.
Better to set zfs_vdev_cache_size to zero, i.e. in /etc/system
set zfs:zfs_vdev_cache_size = 0

After some performance verification, it might make sense to
change the default to zero in uts/common/fs/zfs/vdev_cache.c


Updated by Garrett D'Amore about 10 years ago

  • Category set to kernel
  • Assignee set to Garrett D'Amore

Solaris 11 has been running with the tunable set to zero for a while now. Eventually we ought to just remove the code.


Updated by Garrett D'Amore almost 10 years ago

We end up storing 10MB of readahead per vdev, and so if you have many
vdevs (say, if you sell storage systems), that really sucks on main

We find that the cache is usually very under utilized in the field. (30%-70%)


Updated by Garrett D'Amore almost 10 years ago

  • Status changed from New to Resolved

Resolved in:

garrett@thinkpad{15}> hg export tip
  1. HG changeset patch
  2. User Garrett D'Amore <>
  3. Date 1303458581 25200
  4. Node ID f3ce1af7c12d88b7e9513aad2e7e1b20cae5bab0
  5. Parent 20c193a013b852a0435f528a95759f9684d9115a
    175 zfs vdev cache consumes excessive memory
    Reviewed by: George Wilson <>
    Reviewed by: Eric Schrock <>
    Approved by: Richard Lowe <>

Updated by Jim Klimov about 9 years ago

  • Difficulty set to Medium
  • Tags set to needs-triage

I object to removal of the code for everybody based on its inefficiency for somebody. For example, vdev prefetch was very efficient during a scrub on my systems and boosted the scrub speed (minus several hours off the total count for two scrubs).
In fact, I propose to expand the feature by making a separate rolling cache for non-metadata sectors which are currently discarded from prefetched data.
Tuning the two cache sizes is the end-user's adventure, and zero-size defaults can protect the multiple-drive systems with miniature RAM. illumos's task is to provide the mechanisms that can help it suit everyone - from single-spindle laptops to petabyte arrays ;)
Details are tracked here:

Also available in: Atom PDF