openzfsonwindows / ZFSin

OpenZFS on Windows port

Home Page:https://openzfsonwindows.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are arc tuneables read during runtime?

chid opened this issue · comments

I have been running ZFSin for a bit over two weeks and I've noticed that it consumes a huge chunk of my memory (20GB) without any way for me to reduce the amount. I have tried to set the zfs_arc_max to a much lower figure (500MB) and it appears that it's not honored. I have now adjusted it using the registry settings.

I expect that the answer would be to export and then reimport though I have had bluescreens the last few times I've tried to do this.

I noticed there was a similar issue occurring with ZFS openzfs/zfs#8463 though that code block doesn't appear to exist in ZFSin.

If you want to change things dynamically (without rebooting), you can use the kstat tool;

https://openzfsonosx.org/wiki/Windows_kstat

I have tried using the command kstat.exe -w zfs:0:tunable:zfs_arc_max=5368709 and it didn't seem to have an impact. This is on version OpenZFSOnWindows-release-20200814.exe

the zfs_arc_max is the write variable - then you read the new value from the other arc_max variable - i dont know why they split them. There is also a variable to simulate memory pressure - to make arc deflate

I assume you mean the other values are c, c_min, c_max

(base) PS C:\Windows\system32> kstat.exe -w zfs:0:tunable:zfs_arc_max=5368709
zfs:0:tunable:zfs_arc_max: 0 -> 5368709
(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c                               16060096512

(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c_max
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c_max                           16060096512

(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c_min
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c_min                           2007512064

(base) PS C:\Windows\system32> kstat.exe -w zfs:0:tunable:zfs_arc_max=2007512064
zfs:0:tunable:zfs_arc_max: 5368709 -> 2007512064
(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c_min
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c_min                           2007512064

(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c_max
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c_max                           2007512064

(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c                               2007512064

(base) PS C:\Windows\system32> kstat.exe zfs:0:arcstats:c
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c                               2007512064

Up until this point it appears nothing has changed (on my system ZFS still using ~16GB of ram)

I tried to update the zfs_arc_overflow_shift tuneable and it appears to trigger a change in memory usage (though not to the target size) to around 9GB.

Do you want me to write up something for the wiki?