How to confirm if prefetch is enabled or not?

Status
Not open for further replies.

b1ghen

Contributor
Joined
Oct 19, 2011
Messages
113
Hi,

I searched and couldn't really find an answer to this, and then I'm not sure this is posted in the right forum either.

Anyway, I have a pair of Freenas servers running 8.0.1 RELEASE AMD64, one has 4GB of RAM and the other 8GB.
I haven't fiddled with loader.conf to enable prefetch yet so the default settings should be in effect, so the 4GB machine shouldn't use prefetch but the 8GB should.
Is there a way to confirm if prefetch is enabled on a running system?
 

leenux_tux

Patron
Joined
Sep 3, 2011
Messages
238
How to confirm if prefetch is enabled or not

Hullo,

As I understand it prefetch is only disabled on i386 systems and on systems that are running less than 4GB of RAM?

Both of your systems are running AMD64's, did you install 64 bit FreeNAS on both of these boxes ?

There is a value in /boot/loader.conf that dictates if it is enabled or not.

"set vfs.zfs.prefectch_disable=0" says enable prefetch
"set vfs.zfs.prefectch_disable=1" says disable prefetch

A hint of caution though. Be careful editing these values as I have managed to lock a machine up messing around with these.

A fellow "N00b".

Some interesting info as well here http://wiki.freebsd.org/ZFSTuningGuide
 

b1ghen

Contributor
Joined
Oct 19, 2011
Messages
113
As I understand it prefetch is only disabled on i386 systems and on systems that are running less than 4GB of RAM?

That is how I understand it as well, or in prectice it seems you need to have MORE than 4GB of RAM to have it enabled by default.

Both of your systems are running AMD64's, did you install 64 bit FreeNAS on both of these boxes ?

Yes, they are both running the 64 bit version (AMD64) although one is using an AMD CPU and the other Intel CPU, both 64-bits though.

There is a value in /boot/loader.conf that dictates if it is enabled or not.

"set vfs.zfs.prefectch_disable=0" says enable prefetch
"set vfs.zfs.prefectch_disable=1" says disable prefetch

A hint of caution though. Be careful editing these values as I have managed to lock a machine up messing around with these.

Yes I thought about enabling it for my 4GB machine but I am having doubts, I don't really want to risk 8TB of data for a potentially minimal speed increase, maybe I will just invest a few bucks in another 4GB stick of RAM to be safe.

A fellow "N00b".

Some interesting info as well here http://wiki.freebsd.org/ZFSTuningGuide


Thanks for the tips, although what I was mostly interested in was if I could confirm if prefetching is enabled on my 8GB machine? Anyone?
 

leenux_tux

Patron
Joined
Sep 3, 2011
Messages
238
hello b1ghen,

So there are no entries in /boot/loader.conf that relate to "set vfs.zfs.prefectch_disable=something" ??
 

b1ghen

Contributor
Joined
Oct 19, 2011
Messages
113
hello b1ghen,

So there are no entries in /boot/loader.conf that relate to "set vfs.zfs.prefectch_disable=something" ??

No, that value is not there in my installations at least. The loader.conf is surprisingly clean, has very few rows.

Code:
#
# Boot loader file for FreeNAS.  This relies on a hacked beastie.4th.
#
autoboot_delay="2"
loader_logo="freenas"
#Fix booting from USB device bug
kern.cam.boot_delay=10000

# GEOM support
geom_mirror_load="YES"
geom_stripe_load="YES"
geom_raid3_load="YES"
#geom_raid5_load="YES"
geom_gate_load="YES"
ntfs_load="YES"
smbfs_load="YES"
xhci_load="YES"

hw.hptrr.attach_generic=0


Guess I will just have to assume that prefetch is enabled on the 8GB machine :)
 

leenux_tux

Patron
Joined
Sep 3, 2011
Messages
238

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Run "sysctl vfs.zfs.prefetch_disable" at the command line - should give a value of 0 to indicate that prefetch is enabled, and 1 for prefetch disabled.

By default, Will be enabled if you have *more* than 4GB RAM, and will be disabled for 4GB or less.
 

b1ghen

Contributor
Joined
Oct 19, 2011
Messages
113

b1ghen

Contributor
Joined
Oct 19, 2011
Messages
113
Run "sysctl vfs.zfs.prefetch_disable" at the command line - should give a value of 0 to indicate that prefetch is enabled, and 1 for prefetch disabled.

By default, Will be enabled if you have *more* than 4GB RAM, and will be disabled for 4GB or less.

Perfect, this is exactly what I was looking for! Right now I can only access the 8GB server but it seems to have prefetch enabled like it should:
Code:
[root@mmfs004] /var/log# sysctl vfs.zfs.prefetch_disable
vfs.zfs.prefetch_disable: 0
[root@mmfs004] /var/log#


Thanks again
 
Status
Not open for further replies.
Top