Memory Usage set to zero?

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

Memory Usage set to zero?

Postby zisper » Thu Jul 21, 2016 1:26 pm

Hi;

I was looking at the wiki on memory usage, and ran some of the commands to check what was going on with my machine:

Code: Select all
sysctl kstat | grep arc_max
kstat.zfs.darwin.tunable.zfs_arc_max: 0


Hmm, that doesn't seem right? Unless it's set to zero to disable any memory limit and let the system deal with flushing it as necessary? However the amount in use seemed fairly low:

Code: Select all
kstat.spl.misc.spl_misc.os_mem_alloc: 1377828864


~1.4GB? The machine has 8GB installed, and (at the minute) a 4 way mirror zpool that's 160GB in size. I thought it'd use more memory while resilvering?

Code: Select all
  pool: PlayPool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
   continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Fri Jul 22 07:05:25 2016
    33.1G scanned out of 92.6G at 31.5M/s, 0h32m to go
    33.1G resilvered, 35.69% done
config:

   NAME                                            STATE     READ WRITE CKSUM
   PlayPool                                        ONLINE       0     0     0
     mirror-0                                      ONLINE       0     0     0
       media-A60B02CA-7402-7C45-B211-7A8CB12548B8  ONLINE       0     0     0
       media-30C9BC7E-7CD4-7F4D-9A6F-8AB111C16C26  ONLINE       0     0     0
       media-106B2374-76F3-7647-993F-1C0F45C983AA  ONLINE       0     0     0
       disk0s4                                     ONLINE       0     0     0  (resilvering)


Is arc_max meant to be set to zero, or should I set it to a realistic value for my machine?
zisper
 
Posts: 16
Joined: Wed Jul 20, 2016 2:48 am

Re: Memory Usage set to zero?

Postby Brendon » Thu Jul 21, 2016 2:26 pm

Tunables are write only. Reading them back is meaningless. If you modify kstat.zfs.darwin.tunable.zfs_arc_max, the response is reflected elsewhere in the kstat tree.

- Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: Memory Usage set to zero?

Postby zisper » Thu Jul 21, 2016 7:00 pm

Ok, so the wiki page (https://openzfsonosx.org/wiki/Performance) needs to be updated then? It seems to state that's how to check what arc_max is set to.

Note that this value is more than likely greater than the configured maximum ARC size due to overheads in the allocator itself. By way of example on a 32GB iMac with the ARC set for 8GB.
$ sysctl kstat | grep arc_max
kstat.zfs.darwin.tunable.zfs_arc_max: 8589934592
$ sysctl kstat.spl.misc.spl_misc.os_mem_alloc
kstat.spl.misc.spl_misc.os_mem_alloc: 11866734592


How would I go about checking the current arc_max value then? Look for the setting inside of /etc/zfs/zsysctl.conf?

Thanks for the advice.
zisper
 
Posts: 16
Joined: Wed Jul 20, 2016 2:48 am

Re: Memory Usage set to zero?

Postby Brendon » Thu Jul 21, 2016 8:44 pm

Ok I will rephrase, reading the tunable, unless previously written to will return 0. The max ARC size is reflected in kstat.zfs.misc.arcstats.c_max.

Note: This does not equal the amount of memory ZFS will use, it will often be 40% higher than that.

- Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 5 guests