]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r286570: 5408 managing ZFS cache devices requires lots of RAM
authormav <mav@FreeBSD.org>
Sat, 3 Oct 2015 07:27:58 +0000 (07:27 +0000)
committermav <mav@FreeBSD.org>
Sat, 3 Oct 2015 07:27:58 +0000 (07:27 +0000)
commitbcd238ca436a2c4776cf0bdb90fa7b0986f00483
treebea05b621e09e97a546ddb15fa3d01e6fff88a84
parent21d16f9dcd16d9ed664deee897d47b49f9091be0
MFC r286570: 5408 managing ZFS cache devices requires lots of RAM
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Chris Williamson <Chris.Williamson@delphix.com>

illumos/illumos-gate@89c86e32293a30cdd7af530c38b2073fee01411c

Currently, every buffer cached in the L2ARC is accompanied by a 240-byte
header in memory, leading to very high memory consumption when using very
large cache devices. These changes significantly reduce this overhead.

Currently:

L1-only header = 176 bytes
L1 + L2 or L2-only header = 176 bytes + 32 byte checksum + 32 byte l2hdr
    = 240 bytes

Memory-optimized:

L1-only header = 176 bytes
L1 + L2 header = 176 bytes + 32 byte checksum = 208 bytes
L2-only header = 96 bytes + 32 byte checksum = 128 bytes

So overall:

          Trunk  Optimized
        +-----------------+
L1-only | 176 B  | 176 B  | (same)
        +-----------------+
L1 & L2 | 240 B  | 208 B  | (saved 32 bytes)
        +-----------------+
L2-only | 240 B  | 128 B  | (saved 116 bytes)
        +-----------------+

For an average blocksize of 8KB, this means that for the L2ARC, the ratio
of metadata to data has gone down from about 2.92% to 1.56%.  For a
'storage optimized' EC2 instance with 1600GB of SSD and 60GB of RAM, this
means that we expect a completely full L2ARC to use (1600 GB * 0.0156) /
60GB = 41% of the available memory, down from 78%.

Relnotes: yes
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h