# ZFS prefetch and version 15 (says zdb)



## bsus (May 5, 2012)

Hello,

I have two small questions:

When I look at the output of *zdb* it shows me some version: 15. If this is the zpool version how to I update it to 28?

```
storage:
    version: 15
    name: 'storage'
    state: 0
    txg: 82129
    pool_guid: 9829471014684874704
    hostid: 2451903120
    hostname: 'freebsd.fritz.box'
    vdev_tree:
        type: 'root'
        id: 0
        guid: 9829471014684874704
        children[0]:
            type: 'raidz'
            id: 0
            guid: 10390267300613688534
            nparity: 1
            metaslab_array: 23
            metaslab_shift: 36
            ashift: 12
            asize: 10001970626560
            is_log: 0
            children[0]:
                type: 'disk'
                id: 0
                guid: 7550062277822599630
                path: '/dev/ad14'
                whole_disk: 0
                DTL: 39
            children[1]:
                type: 'disk'
                id: 1
                guid: 18270682394040670718
                path: '/dev/ad12'
                whole_disk: 0
                DTL: 33
            children[2]:
                type: 'disk'
                id: 2
                guid: 3434028092235582287
                path: '/dev/ad10'
                whole_disk: 0
                DTL: 38
            children[3]:
                type: 'disk'
                id: 3
                guid: 15523591088480269778
                path: '/dev/ad8'
                whole_disk: 0
                DTL: 37
            children[4]:
                type: 'disk'
                id: 4
                guid: 15725915913102441650
                path: '/dev/ad6'
                whole_disk: 0
                DTL: 36
```

How does it look with prefetch? I have a 8GB system and following `# sysctl -a | grep zfs` prefetch is disabled. Should I disable it with `# echo 'vfs.zfs.prefetch_disable="1"' >> /boot/loader.conf`?

```
vfs.zfs.l2c_only_size: 0
vfs.zfs.mfu_ghost_data_lsize: 2583117312
vfs.zfs.mfu_ghost_metadata_lsize: 21093376
vfs.zfs.mfu_ghost_size: 2604210688
vfs.zfs.mfu_data_lsize: 269518848
vfs.zfs.mfu_metadata_lsize: 233954304
vfs.zfs.mfu_size: 555539456
vfs.zfs.mru_ghost_data_lsize: 1209966592
vfs.zfs.mru_ghost_metadata_lsize: 121684480
vfs.zfs.mru_ghost_size: 1331651072
vfs.zfs.mru_data_lsize: 2147169280
vfs.zfs.mru_metadata_lsize: 316843008
vfs.zfs.mru_size: 2668107776
vfs.zfs.anon_data_lsize: 0
vfs.zfs.anon_metadata_lsize: 0
vfs.zfs.anon_size: 19824640
vfs.zfs.l2arc_norw: 1
vfs.zfs.l2arc_feed_again: 1
vfs.zfs.l2arc_noprefetch: 1
vfs.zfs.l2arc_feed_min_ms: 200
vfs.zfs.l2arc_feed_secs: 1
vfs.zfs.l2arc_headroom: 2
vfs.zfs.l2arc_write_boost: 8388608
vfs.zfs.l2arc_write_max: 8388608
vfs.zfs.arc_meta_limit: 1781440512
vfs.zfs.arc_meta_used: 1593177520
vfs.zfs.arc_min: 890720256
vfs.zfs.arc_max: 7125762048
vfs.zfs.dedup.prefetch: 1
vfs.zfs.mdcomp_disable: 0
vfs.zfs.write_limit_override: 0
vfs.zfs.write_limit_inflated: 25450426368
vfs.zfs.write_limit_max: 1060434432
vfs.zfs.write_limit_min: 33554432
vfs.zfs.write_limit_shift: 3
vfs.zfs.no_write_throttle: 0
vfs.zfs.zfetch.array_rd_sz: 1048576
vfs.zfs.zfetch.block_cap: 256
vfs.zfs.zfetch.min_sec_reap: 2
vfs.zfs.zfetch.max_streams: 8
vfs.zfs.prefetch_disable: 1
vfs.zfs.mg_alloc_failures: 8
vfs.zfs.check_hostid: 1
vfs.zfs.recover: 0
vfs.zfs.txg.synctime_ms: 1000
vfs.zfs.txg.timeout: 5
vfs.zfs.scrub_limit: 10
vfs.zfs.vdev.cache.bshift: 16
vfs.zfs.vdev.cache.size: 0
vfs.zfs.vdev.cache.max: 16384
vfs.zfs.vdev.write_gap_limit: 4096
vfs.zfs.vdev.read_gap_limit: 32768
vfs.zfs.vdev.aggregation_limit: 131072
vfs.zfs.vdev.ramp_rate: 2
vfs.zfs.vdev.time_shift: 6
vfs.zfs.vdev.min_pending: 4
vfs.zfs.vdev.max_pending: 10
vfs.zfs.vdev.bio_flush_disable: 0
vfs.zfs.cache_flush_disable: 0
vfs.zfs.zil_replay_disable: 0
vfs.zfs.zio.use_uma: 0
vfs.zfs.version.zpl: 5
vfs.zfs.version.spa: 28
vfs.zfs.version.acl: 1
vfs.zfs.debug: 0
vfs.zfs.super_owner: 0
kstat.zfs.misc.xuio_stats.onloan_read_buf: 0
kstat.zfs.misc.xuio_stats.onloan_write_buf: 0
kstat.zfs.misc.xuio_stats.read_buf_copied: 0
kstat.zfs.misc.xuio_stats.read_buf_nocopy: 0
kstat.zfs.misc.xuio_stats.write_buf_copied: 0
kstat.zfs.misc.xuio_stats.write_buf_nocopy: 3063
kstat.zfs.misc.zfetchstats.hits: 0
kstat.zfs.misc.zfetchstats.misses: 0
kstat.zfs.misc.zfetchstats.colinear_hits: 0
kstat.zfs.misc.zfetchstats.colinear_misses: 0
kstat.zfs.misc.zfetchstats.stride_hits: 0
kstat.zfs.misc.zfetchstats.stride_misses: 0
kstat.zfs.misc.zfetchstats.reclaim_successes: 0
kstat.zfs.misc.zfetchstats.reclaim_failures: 0
kstat.zfs.misc.zfetchstats.streams_resets: 0
kstat.zfs.misc.zfetchstats.streams_noresets: 0
kstat.zfs.misc.zfetchstats.bogus_streams: 0
kstat.zfs.misc.arcstats.hits: 8141126
kstat.zfs.misc.arcstats.misses: 135321
kstat.zfs.misc.arcstats.demand_data_hits: 3123324
kstat.zfs.misc.arcstats.demand_data_misses: 58726
kstat.zfs.misc.arcstats.demand_metadata_hits: 5012313
kstat.zfs.misc.arcstats.demand_metadata_misses: 74962
kstat.zfs.misc.arcstats.prefetch_data_hits: 3852
kstat.zfs.misc.arcstats.prefetch_data_misses: 1048
kstat.zfs.misc.arcstats.prefetch_metadata_hits: 1637
kstat.zfs.misc.arcstats.prefetch_metadata_misses: 585
kstat.zfs.misc.arcstats.mru_hits: 725126
kstat.zfs.misc.arcstats.mru_ghost_hits: 8203
kstat.zfs.misc.arcstats.mfu_hits: 7411914
kstat.zfs.misc.arcstats.mfu_ghost_hits: 5414
kstat.zfs.misc.arcstats.allocated: 990123
kstat.zfs.misc.arcstats.deleted: 195380
kstat.zfs.misc.arcstats.stolen: 18831
kstat.zfs.misc.arcstats.recycle_miss: 2458
kstat.zfs.misc.arcstats.mutex_miss: 2
kstat.zfs.misc.arcstats.evict_skip: 0
kstat.zfs.misc.arcstats.evict_l2_cached: 0
kstat.zfs.misc.arcstats.evict_l2_eligible: 7899840000
kstat.zfs.misc.arcstats.evict_l2_ineligible: 3350016
kstat.zfs.misc.arcstats.hash_elements: 188147
kstat.zfs.misc.arcstats.hash_elements_max: 274496
kstat.zfs.misc.arcstats.hash_collisions: 767699
kstat.zfs.misc.arcstats.hash_chains: 53025
kstat.zfs.misc.arcstats.hash_chain_max: 14
kstat.zfs.misc.arcstats.p: 3759418436
kstat.zfs.misc.arcstats.c: 4009995165
kstat.zfs.misc.arcstats.c_min: 890720256
kstat.zfs.misc.arcstats.c_max: 7125762048
kstat.zfs.misc.arcstats.size: 4009865648
kstat.zfs.misc.arcstats.hdr_size: 53434224
kstat.zfs.misc.arcstats.data_size: 3243471872
kstat.zfs.misc.arcstats.other_size: 712959552
kstat.zfs.misc.arcstats.l2_hits: 0
kstat.zfs.misc.arcstats.l2_misses: 0
kstat.zfs.misc.arcstats.l2_feeds: 0
kstat.zfs.misc.arcstats.l2_rw_clash: 0
kstat.zfs.misc.arcstats.l2_read_bytes: 0
kstat.zfs.misc.arcstats.l2_write_bytes: 0
kstat.zfs.misc.arcstats.l2_writes_sent: 0
kstat.zfs.misc.arcstats.l2_writes_done: 0
kstat.zfs.misc.arcstats.l2_writes_error: 0
kstat.zfs.misc.arcstats.l2_writes_hdr_miss: 0
kstat.zfs.misc.arcstats.l2_evict_lock_retry: 0
kstat.zfs.misc.arcstats.l2_evict_reading: 0
kstat.zfs.misc.arcstats.l2_free_on_write: 0
kstat.zfs.misc.arcstats.l2_abort_lowmem: 0
kstat.zfs.misc.arcstats.l2_cksum_bad: 0
kstat.zfs.misc.arcstats.l2_io_error: 0
kstat.zfs.misc.arcstats.l2_size: 0
kstat.zfs.misc.arcstats.l2_hdr_size: 0
kstat.zfs.misc.arcstats.memory_throttle_count: 0
kstat.zfs.misc.arcstats.l2_write_trylock_fail: 0
kstat.zfs.misc.arcstats.l2_write_passed_headroom: 0
kstat.zfs.misc.arcstats.l2_write_spa_mismatch: 0
kstat.zfs.misc.arcstats.l2_write_in_l2: 0
kstat.zfs.misc.arcstats.l2_write_io_in_progress: 0
kstat.zfs.misc.arcstats.l2_write_not_cacheable: 823
kstat.zfs.misc.arcstats.l2_write_full: 0
kstat.zfs.misc.arcstats.l2_write_buffer_iter: 0
kstat.zfs.misc.arcstats.l2_write_pios: 0
kstat.zfs.misc.arcstats.l2_write_buffer_bytes_scanned: 0
kstat.zfs.misc.arcstats.l2_write_buffer_list_iter: 0
kstat.zfs.misc.arcstats.l2_write_buffer_list_null_iter: 0
kstat.zfs.misc.vdev_cache_stats.delegations: 0
kstat.zfs.misc.vdev_cache_stats.hits: 0
kstat.zfs.misc.vdev_cache_stats.misses: 0
```

Best Regards,
bsus


----------



## bsus (May 5, 2012)

```
server ~ # zpool upgrade
This system is currently running ZFS pool version 28.

All pools are formatted using this version.
server ~ # zdb | grep version
    version: 15
server ~ # zpool upgrade storage
This system is currently running ZFS pool version 28.

Pool 'storage' is already formatted using the current version.
server ~ #
```


----------



## Beeblebrox (May 5, 2012)

`# zpool upgrade -a`



> prefetch is disabled. Should I disable it with


What?? Disable is for low ram (< 1 G) systems. You can and should enable it. It should be detected and enabled by default with 8G RAM, unless you have specifically disabled it. All details:
http://wiki.freebsd.org/ZFSTuningGuide


----------



## gkontos (May 5, 2012)

It really depends on how much memory the system has. zfs.prefetch is enabled by default only if you have > 4GB of RAM. 

Disabling zfs.prefetch is also recommended if you are doing a lot of synchronous I/O

A good candidate is innodb databases.


----------



## bsus (May 5, 2012)

Hi,

I have enabled prefetch in the loader.conf 

There is now only this strange thing with the my zfs data storage:

```
server ~ # zpool upgrade -a 
This system is currently running ZFS pool version 28.

All pools are formatted using this version.
server ~ # zdb | grep version
    version: 15
server ~ #
```


----------



## gkontos (May 6, 2012)

Make sure your kernel and world are in synch.


----------

