Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2009 09:14:30 +0300
From:      Artemiev Igor <ai@kliksys.ru>
To:        freebsd-fs@freebsd.org
Subject:   Low zfs prefetch hits - why?
Message-ID:  <20091105061430.GA92808@one.kliksys.ru>

next in thread | raw e-mail | index | archive | help

#sysctl vfs.zfs.zfetch
vfs.zfs.zfetch.array_rd_sz: 524288
vfs.zfs.zfetch.block_cap: 8
vfs.zfs.zfetch.min_sec_reap: 2
vfs.zfs.zfetch.max_streams: 8

Trying to sequential read 1G file by 128K chunks.
#./arcstat.pl -f Time,pmis,pm%
	Time  pmis  pm%
    05:48:40   749  100
    05:48:41    1K  100
    05:48:42    1K  100
    05:48:43    1K  100
    05:48:44    1K  100
    05:48:45    1K  100
    05:48:46    1K  100
    05:48:47   257   99

I thought, blocks didn`t prefetching and wrote small dtrace script:

#!/usr/sbin/dtrace -qs

fbt:zfs:dmu_zfetch:entry
{
    printf("dmu_zfetch: offset=%ld size=%ld prefetched=%ld\n", arg1, arg2, arg3);
}


fbt:zfs:dbuf_prefetch:entry
{
    printf("  zfetching block %d\n", arg1);
}

Here output:
dmu_zfetch: offset=325058560 size=131072 prefetched=32
dmu_zfetch: offset=325189632 size=131072 prefetched=32
dmu_zfetch: offset=325320704 size=131072 prefetched=32
dmu_zfetch: offset=325451776 size=131072 prefetched=32
dmu_zfetch: offset=325582848 size=131072 prefetched=32
dmu_zfetch: offset=326369280 size=131072 prefetched=32
dmu_zfetch: offset=326500352 size=131072 prefetched=32
dmu_zfetch: offset=326631424 size=131072 prefetched=32
dmu_zfetch: offset=326762496 size=131072 prefetched=32
dmu_zfetch: offset=326893568 size=131072 prefetched=32
dmu_zfetch: offset=327024640 size=131072 prefetched=32
  zfetching block 2503
  zfetching block 2504
  zfetching block 2505
  zfetching block 2506
  zfetching block 2507
  zfetching block 2508
  zfetching block 2509
  zfetching block 2510
dmu_zfetch: offset=327155712 size=131072 prefetched=32
dmu_zfetch: offset=327286784 size=131072 prefetched=32
dmu_zfetch: offset=327417856 size=131072 prefetched=32
dmu_zfetch: offset=327548928 size=131072 prefetched=32
dmu_zfetch: offset=327680000 size=131072 prefetched=32

Why this happening? Statistic is unrelevant?
With sendfile(2) prefetching completely didn`t work - no forward read ahead.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091105061430.GA92808>