root / plugins / zfs / zfs_cache_efficiency @ e5ce7492
Historique | Voir | Annoter | Télécharger (6,84 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
# ZFS ARC statistics for FreeBSD |
| 3 |
# Author alex@trull.org: |
| 4 |
# |
| 5 |
#%# family=auto |
| 6 |
#%# capabilities=autoconf |
| 7 |
|
| 8 |
sysctl='/sbin/sysctl' |
| 9 |
|
| 10 |
case $1 in |
| 11 |
config) |
| 12 |
cat <<EOF |
| 13 |
graph_title ZFS ARC efficiency |
| 14 |
graph_vlabel % |
| 15 |
graph_scale no |
| 16 |
graph_category filesystem |
| 17 |
graph_args -l 0 |
| 18 |
graph_info FreeBSD ZFS ARC Utilisation - Counters |
| 19 |
graph_period minute |
| 20 |
graph_order hits misses l2_hits l2_misses mfu_hits mru_hits arc_access_total mfu_hits_perc mru_hits_perc arc_misses_perc l2_efficency_tot |
| 21 |
deleted.graph no |
| 22 |
deleted.min 0 |
| 23 |
deleted.type DERIVE |
| 24 |
deleted.label Deleted? |
| 25 |
demand_data_hits.graph no |
| 26 |
demand_data_hits.min 0 |
| 27 |
demand_data_hits.type DERIVE |
| 28 |
demand_data_hits.label Cache hits - demand data |
| 29 |
demand_data_misses.graph no |
| 30 |
demand_data_misses.min 0 |
| 31 |
demand_data_misses.type DERIVE |
| 32 |
demand_data_misses.label Cache miss - demand data |
| 33 |
demand_metadata_hits.graph no |
| 34 |
demand_metadata_hits.min 0 |
| 35 |
demand_metadata_hits.type DERIVE |
| 36 |
demand_metadata_hits.label Cache hits - metadata |
| 37 |
demand_metadata_misses.graph no |
| 38 |
demand_metadata_misses.min 0 |
| 39 |
demand_metadata_misses.type DERIVE |
| 40 |
demand_metadata_misses.label Cache miss - metadata |
| 41 |
evict_skip.graph no |
| 42 |
evict_skip.min 0 |
| 43 |
evict_skip.type DERIVE |
| 44 |
evict_skip.label evict_skip? |
| 45 |
hash_chain_max.graph no |
| 46 |
hash_chain_max.min 0 |
| 47 |
hash_chain_max.type DERIVE |
| 48 |
hash_chain_max.label hash_chain_max? |
| 49 |
hash_chains.graph no |
| 50 |
hash_chains.min 0 |
| 51 |
hash_chains.type DERIVE |
| 52 |
hash_chains.label hash_chains? |
| 53 |
hash_collisions.graph no |
| 54 |
hash_collisions.min 0 |
| 55 |
hash_collisions.type DERIVE |
| 56 |
hash_collisions.label hash_collisions? |
| 57 |
hash_elements.graph no |
| 58 |
hash_elements.min 0 |
| 59 |
hash_elements.type DERIVE |
| 60 |
hash_elements.label hash_elements |
| 61 |
hash_elements_max.graph no |
| 62 |
hash_elements_max.min 0 |
| 63 |
hash_elements_max.type DERIVE |
| 64 |
hash_elements_max.label hash_elements_max? |
| 65 |
hits.graph no |
| 66 |
hits.min 0 |
| 67 |
hits.type DERIVE |
| 68 |
hits.label Cache hits |
| 69 |
l2_abort_lowmem.graph no |
| 70 |
l2_abort_lowmem.min 0 |
| 71 |
l2_abort_lowmem.type GAUGE |
| 72 |
l2_cksum_bad.graph no |
| 73 |
l2_cksum_bad.min 0 |
| 74 |
l2_cksum_bad.type DERIVE |
| 75 |
l2_cksum_bad.label ARCL2 Bad checksum errors |
| 76 |
l2_evict_lock_retry.graph no |
| 77 |
l2_evict_lock_retry.min 0 |
| 78 |
l2_evict_lock_retry.type DERIVE |
| 79 |
l2_evict_reading.graph no |
| 80 |
l2_evict_reading.min 0 |
| 81 |
l2_evict_reading.type DERIVE |
| 82 |
l2_feeds.graph no |
| 83 |
l2_feeds.min 0 |
| 84 |
l2_feeds.type DERIVE |
| 85 |
l2_free_on_write.graph no |
| 86 |
l2_free_on_write.min 0 |
| 87 |
l2_free_on_write.type DERIVE |
| 88 |
l2_hits.graph no |
| 89 |
l2_hits.min 0 |
| 90 |
l2_hits.type DERIVE |
| 91 |
l2_hits.label L2ARC hits |
| 92 |
l2_io_error.graph no |
| 93 |
l2_io_error.min 0 |
| 94 |
l2_io_error.type DERIVE |
| 95 |
l2_io_error.label L2AC I/O errors |
| 96 |
l2_misses.graph no |
| 97 |
l2_misses.min 0 |
| 98 |
l2_misses.type DERIVE |
| 99 |
l2_misses.label L2ARC cache misses |
| 100 |
l2_rw_clash.graph no |
| 101 |
l2_rw_clash.min 0 |
| 102 |
l2_rw_clash.type DERIVE |
| 103 |
l2_writes_done.graph no |
| 104 |
l2_writes_done.min 0 |
| 105 |
l2_writes_done.type DERIVE |
| 106 |
l2_writes_error.graph no |
| 107 |
l2_writes_error.min 0 |
| 108 |
l2_writes_error.type DERIVE |
| 109 |
l2_writes_hdr_miss.graph no |
| 110 |
l2_writes_hdr_miss.min 0 |
| 111 |
l2_writes_hdr_miss.type DERIVE |
| 112 |
l2_writes_hdr_miss.label L2ARC Header misses |
| 113 |
l2_writes_sent.graph no |
| 114 |
l2_writes_sent.min 0 |
| 115 |
l2_writes_sent.type DERIVE |
| 116 |
l2_writes_sent.label L2ARC writes sent |
| 117 |
memory_throttle_count.graph no |
| 118 |
memory_throttle_count.min 0 |
| 119 |
memory_throttle_count.label memory_throttle_count? |
| 120 |
mfu_ghost_hits.graph no |
| 121 |
mfu_ghost_hits.min 0 |
| 122 |
mfu_ghost_hits.type DERIVE |
| 123 |
mfu_ghost_hits.label Most frequently used ghost hits |
| 124 |
mfu_hits.graph no |
| 125 |
mfu_hits.min 0 |
| 126 |
mfu_hits.type DERIVE |
| 127 |
mfu_hits.label Most frequently used hits |
| 128 |
misses.graph no |
| 129 |
misses.min 0 |
| 130 |
misses.type DERIVE |
| 131 |
misses.label Cache misses |
| 132 |
mru_ghost_hits.graph no |
| 133 |
mru_ghost_hits.min 0 |
| 134 |
mru_ghost_hits.type DERIVE |
| 135 |
mru_ghost_hits.label Most recently used ghost hits |
| 136 |
mru_hits.graph no |
| 137 |
mru_hits.min 0 |
| 138 |
mru_hits.type DERIVE |
| 139 |
mru_hits.label Most recently used hits |
| 140 |
mutex_miss.graph no |
| 141 |
mutex_miss.min 0 |
| 142 |
mutex_miss.type DERIVE |
| 143 |
prefetch_data_hits.graph no |
| 144 |
prefetch_data_hits.min 0 |
| 145 |
prefetch_data_hits.type DERIVE |
| 146 |
prefetch_data_hits.label Prefetch Data hits |
| 147 |
prefetch_data_misses.graph no |
| 148 |
prefetch_data_misses.min 0 |
| 149 |
prefetch_data_misses.type DERIVE |
| 150 |
prefetch_data_misses.label Prefetch data misses |
| 151 |
prefetch_metadata_hits.graph no |
| 152 |
prefetch_metadata_hits.min 0 |
| 153 |
prefetch_metadata_hits.type DERIVE |
| 154 |
prefetch_metadata_hits.label Prefetch metadata hits |
| 155 |
prefetch_metadata_misses.graph no |
| 156 |
prefetch_metadata_misses.min 0 |
| 157 |
prefetch_metadata_misses.type DERIVE |
| 158 |
prefetch_metadata_misses.label Prefetch metadata misses |
| 159 |
recycle_miss.graph no |
| 160 |
recycle_miss.min 0 |
| 161 |
recycle_miss.type DERIVE |
| 162 |
recycle_miss.label Recycle misses |
| 163 |
arc_access_total.graph no |
| 164 |
arc_access_total.cdef hits,misses,ADDNAN |
| 165 |
arc_access_total.label ARC access total number |
| 166 |
arc_hits_perc.cdef hits,100,*,arc_access_total,/ |
| 167 |
arc_hits_perc.label ARC hits |
| 168 |
arc_hits_perc.graph no |
| 169 |
real_hits.cdef mfu_hits,mru_hits,ADDNAN,100,*,hits,/ |
| 170 |
real_hits.label ARC real (MRU + MFU) hits (no ghost & anon) |
| 171 |
real_hits.graph no |
| 172 |
mfu_hits_perc.cdef mfu_hits,100,*,arc_access_total,/ |
| 173 |
mfu_hits_perc.label Most frequently used hits |
| 174 |
mfu_hits_perc.graph yes |
| 175 |
mfu_hits_perc.draw AREA |
| 176 |
mru_hits_perc.cdef mru_hits,100,*,arc_access_total,/ |
| 177 |
mru_hits_perc.label Most recently used hits |
| 178 |
mru_hits_perc.graph yes |
| 179 |
mru_hits_perc.draw STACK |
| 180 |
arc_misses_perc.graph yes |
| 181 |
arc_misses_perc.cdef misses,100,*,arc_access_total,/ |
| 182 |
arc_misses_perc.label ARC misses |
| 183 |
arc_misses_perc.draw STACK |
| 184 |
l2_efficency_tot.graph yes |
| 185 |
l2_efficency_tot.cdef l2_hits,100,*,l2_hits,l2_misses,hits,misses,ADDNAN,ADDNAN,ADDNAN,/ |
| 186 |
l2_efficency_tot.label L2ARC hit ratio of L1&L2 accesses |
| 187 |
EOF |
| 188 |
# demand_data_hits_perc.cdef demand_data_hits,100,*,hits,/ |
| 189 |
# demand_data_hits_perc.label Cache hits of demand data type |
| 190 |
# demand_data_hits_perc.graph no |
| 191 |
# demand_metadata_hits_perc.cdef demand_metadata_hits,100,*,hits,/ |
| 192 |
# demand_metadata_hits_perc.label Cache hits of Demand metadata type |
| 193 |
# demand_metadata_hits_perc.graph no |
| 194 |
# prefetch_data_hits_perc.cdef prefetch_data_hits,100,*,hits,/ |
| 195 |
# prefetch_data_hits_perc.label Prefetch data hits factor of all hits |
| 196 |
# prefetch_data_hits_perc.graph no |
| 197 |
# prefetch_metadata_hits_perc.cdef prefetch_metadata_hits,100,*,hits,/ |
| 198 |
# prefetch_metadata_hits_perc.label Prefetch metadata hits factor off hits |
| 199 |
# prefetch_metadata_hits_perc.graph no |
| 200 |
# demand_data_efficency.cdef demand_data_hits,100,*,demand_data_hits,demand_data_misses,ADDNAN,/ |
| 201 |
# demand_data_efficency.label Data demand efficency |
| 202 |
# demand_data_efficency.graph no |
| 203 |
# anon_hits.graph no |
| 204 |
# anon_hits.cdef hits,mfu_hits,mru_hits,mfu_ghost_hits,mru_ghost_hits,ADDNAN,ADDNAN,ADDNAN,-,100,*,hits,/ |
| 205 |
# anon_hits.label ARC Anon hits |
| 206 |
# mfu_ghost_hits_perc.cdef mfu_ghost_hits,100,*,hits,/ |
| 207 |
# mfu_ghost_hits_perc.label Most frequently used ghost hits |
| 208 |
# mfu_ghost_hits_perc.graph no |
| 209 |
# mru_ghost_hits_perc.cdef mru_ghost_hits,100,*,hits,/ |
| 210 |
# mru_ghost_hits_perc.label Most recently used ghost hits |
| 211 |
# mru_ghost_hits_perc.graph no |
| 212 |
exit 0 |
| 213 |
;; |
| 214 |
autoconf) |
| 215 |
if [ ! -x ${sysctl} ]; then
|
| 216 |
echo "no (${sysctl} is not executable)"
|
| 217 |
exit 1 |
| 218 |
fi |
| 219 |
ostype=`uname -s` |
| 220 |
if [ ${ostype} = "FreeBSD" ]; then
|
| 221 |
echo "yes" |
| 222 |
exit 0 |
| 223 |
fi |
| 224 |
echo "no (You're OS is not supported by this plugin)" |
| 225 |
exit 1 |
| 226 |
;; |
| 227 |
suggest) |
| 228 |
exit 0 |
| 229 |
;; |
| 230 |
esac |
| 231 |
$sysctl kstat.zfs.misc.arcstats | sed -e 's/^kstat.zfs.misc.arcstats.//' -e 's/:/.value/' |
