ZFS ARC size vs target size

performance-countersperformance-monitoringzfs

I am trying to understand the inner workings of the ZFS ARC. However, I am confused with several things:

  1. actual (zfs:0:arcstats:size) vs target size (zfs:0:arcstats:c). I understand that actual size is allocated and stores cached contents. But, what is the target size then? What is the difference between these two?

  2. mru_size (zfs:0:arcstats:p) + mfu_size (zfs:0:arcstats:czfs:0:arcstats:p) vs data_size (zfs:0:arcstats:data_size). Shouldn't data_size be the sum of mru_size and mfu_size? What is the correct ARC size breakdown? According to http://lists.freebsd.org/pipermail/freebsd-fs/2012-June/014643.html, it should be hdr_size + data_size (mru_size + mfu_size + anon_size) + other_size + l2_hdr_size, but it doesn't make any sense as mru_size is usually bigger than data_size.

  3. what is arc memory throttle used for?

Thanks for any answers/pointers.

Best Answer

Well, I am some years late, but I hope that this can help others.

  • c is the target ARC size. It is 50% of total RAM by default, but it can shrink on demand if the system is under memory pressure
  • size is the current ARC size. Given enough time, it will tend to c
  • data_size is the size of cached user data. It does not include metadata (and this is the reason why it can be significantly smaller than MRU and/or MFU when facing metadata-heavy workload)
  • metadata_size is the size of cached metadata
  • hdr_size is the size of L2ARC headers stored in main ARC
  • overhead_size is the size of various buffer which are allocated when decompressing dentries