arc_summary.pl (v0.3)

Description: While ARC is an amazing achievement its memory consumption raises doubts and questions in many administrators and users who view memory as a precious commodity. The Kstat facility provides access to a variety of ARC counters, but interpretting these properly is complex and non-intuative in their raw form, without spending several hours in the arc.c code. The purpose of arc_summary.pl is to provide a historical analysis of the ZFS ARC, to answer such questions as:

  • ARC is consuming 80% of memory. Is the sacrifice worth it?
  • What are the various sizes and limits that make up ARC?
  • What does the cache churn look like?
  • How efficient is prefetch? Should I disable it?

arc_summary.pl is still under heavy development, take its results with a large grain of salt. (8/21/08)


[code]


S Y S T E M 1:
$ ./arc_summary.pl 
System Memory:                  
         Physical RAM:  32759 MB
         Free Memory :  6734 MB 
         LotsFree:      511 MB  
                                
ZFS Tunables (/etc/system):     
                                
ARC Size:                       
         Current Size:             39914 MB (arcsize)
         Target Size (Adaptive):   31735 MB (c)
         Min Size (Hard Limit):    3966 MB (zfs_arc_min)
         Max Size (Hard Limit):    31735 MB (zfs_arc_max)

ARC Size Breakdown:
         Most Recently Used Cache Size:           0%    0 MB (p)
         Most Frequently Used Cache Size:        100%   31735 MB (c-p)

ARC Efficency:
         Cache Access Total:             670097231886
         Cache Hit Ratio:      98%       661915336214           [Defined State for buffer]
         Cache Miss Ratio:      1%       8181895672     [Undefined State for Buffer]
         REAL Hit Ratio:       93%       625641854637           [MRU/MFU Hits Only]

         Data Demand   Efficiency:    98%
         Data Prefetch Efficiency:    99%

        CACHE HITS BY CACHE LIST:
          Anon:                        4%        29431079074                    [ New Customer, First Cache Hit ]
          Most Recently Used:          0%        2122361572 (mru)       [ Return Customer ]
          Most Frequently Used:       94%        623519493065 (mfu)             [ Frequent Customer ]
          Most Recently Used Ghost:    0%        1773723345 (mru_ghost) [ Return Customer Evicted, Now Back ]
          Most Frequently Used Ghost:  0%        5068679158 (mfu_ghost) [ Frequent Customer Evicted, Now Back ]
        CACHE HITS BY DATA TYPE:
          Demand Data:                73%        487401027055 
          Prefetch Data:              19%        126193017075 
          Demand Metadata:             2%        17287144100 
          Prefetch Metadata:           4%        31034147984 
        CACHE MISSES BY DATA TYPE:
          Demand Data:                92%        7553812411 
          Prefetch Data:               0%        61829125 
          Demand Metadata:             2%        242779785 
          Prefetch Metadata:           3%        323474351 
---------------------------------------------

S Y S T E M 2:
$ ./arc_summary.pl 
System Memory:
         Physical RAM:  16247 MB
         Free Memory :  1064 MB
         LotsFree:      253 MB

ZFS Tunables (/etc/system):

ARC Size:
         Current Size:             5931 MB (arcsize)
         Target Size (Adaptive):   5985 MB (c)
         Min Size (Hard Limit):    507 MB (zfs_arc_min)
         Max Size (Hard Limit):    15223 MB (zfs_arc_max)

ARC Size Breakdown:
         Most Recently Used Cache Size:          73%    4405 MB (p)
         Most Frequently Used Cache Size:        26%    1579 MB (c-p)

ARC Efficency:
         Cache Access Total:             30934237785
         Cache Hit Ratio:      99%       30933044424    [Defined State for buffer]
         Cache Miss Ratio:      0%       1193361        [Undefined State for Buffer]
         REAL Hit Ratio:       99%       30888972063    [MRU/MFU Hits Only]

         Data Demand   Efficiency:    99%
         Data Prefetch Efficiency:    99%

        CACHE HITS BY CACHE LIST:
          Anon:                        0%        43145095               [ New Customer, First Cache Hit ]
          Most Recently Used:          0%        56656566 (mru)         [ Return Customer ]
          Most Frequently Used:       99%        30832315497 (mfu)              [ Frequent Customer ]
          Most Recently Used Ghost:    0%        280356 (mru_ghost)     [ Return Customer Evicted, Now Back ]
          Most Frequently Used Ghost:  0%        646910 (mfu_ghost)     [ Frequent Customer Evicted, Now Back ]
        CACHE HITS BY DATA TYPE:
          Demand Data:                78%        24388331448 
          Prefetch Data:              19%        6013656064 
          Demand Metadata:             1%        472836583 
          Prefetch Metadata:           0%        58220329 
        CACHE MISSES BY DATA TYPE:
          Demand Data:                21%        255389 
          Prefetch Data:              32%        385838 
          Demand Metadata:            31%        381534 
          Prefetch Metadata:          14%        170600 
---------------------------------------------