ZFS File-Level Prefetching

File-Level Prefetching

ZFS implements a file-level prefetching mechanism labeled zfetch. This mechanism looks at the patterns of reads to files, and anticipates on some reads, reducing application wait times. The current code needs attention (RFE below) and suffers from 2 drawbacks:

* Sequential read patterns made of small reads very often hit in the cache. In this case, the current code consumes a significant amount of CPU time trying to find the next I/O to issue, whereas performance is governed more by the CPU availability.

* The zfetch code has been observed to limit scalability of some loads.

So, if CPU profiling, by using lockstat(1M) with -I argument or er_kernel as described here:

http://developers.sun.com/prodtech/cc/articles/perftools.html

shows significant time in zfetch_* functions, or if lock profiling (lockstat(1m)) shows contention around zfetch locks, then disabling file level prefetching should be considered.

Disabling prefetching can be achieved dynamically or through a setting in the /etc/system file.

If you tune this parameter, please reference this URL in shell script or in an /etc/system comment.

http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide#ZFETCH
Solaris 10 8/07 and Solaris Nevada (snv_51) Releases

Set dynamically:

echo zfetch_prefetch_disable/W0t1 | mdb -kw

Revert to default:

echo zfetch_prefetch_disable/W0t0 | mdb -kw

Set the following parameter in the /etc/system file:

set zfs:zfetch_prefetch_disable = 1

Earlier Solaris Releases

Set dynamically:

echo zfetch_array_rd_sz/Z0x0 | mdb -kw

Revert to default:

echo zfetch_array_rd_sz/Z0x100000 | mdb -kw

Set the following parameter in the /etc/system file:

set zfs:zfetch_array_rd_sz = 0

RFEs

* 6412053 zfetch needs some love

http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6412053

* 6579975 dnode_new_blkid should first check as RW_READER

http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6579975

Leave a Reply

Your email address will not be published. Required fields are marked *