Skip to content

Commit

Permalink
Merge pull request #2539 from freenas/fix-73875
Browse files Browse the repository at this point in the history
[autotune] Set vfs.zfs.dirty_data_max_max for TrueNAS M series
  • Loading branch information
Ryan Moeller committed Feb 7, 2019
2 parents f856200 + 3afac77 commit aa4f3da
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions src/autotune/files/autotune.py
Expand Up @@ -135,6 +135,7 @@ def sysctl_int(oid):
DEF_KNOBS = {
'loader': {
'vm.kmem_size',
'vfs.zfs.dirty_data_max_max',
},
'sysctl': {
'kern.ipc.maxsockbuf',
Expand Down Expand Up @@ -166,6 +167,17 @@ def sysctl_int(oid):
}


def guess_vm_kmem_size():
return int(1.25 * HW_PHYSMEM)


def guess_vfs_zfs_dirty_data_max_max():
if TRUENAS and hardware[0].startswith("M"):
return 12 * GB
else:
return None


def guess_kern_ipc_maxsockbuf():
"""Maximum socket buffer.
Expand All @@ -188,30 +200,6 @@ def guess_kern_ipc_maxsockbuf():
return 2 * MB


# kern.ipc.maxsockets

# kern.ipc.somaxconn


def guess_kern_maxfiles():
"""Maximum number of files that can be opened on a system
- Samba sets this to 16k by default to meet a Windows minimum value.
"""
# XXX: should be dynamically tuned based on the platform profile.
# Currently not used, and 10.x default value is way higher than this
return 65536


def guess_kern_maxfilesperproc():
"""Maximum number of files that can be opened per process
- FreeBSD defined ratio is 9:10, but that's with lower limits.
"""
# Currently not used
return int(0.8 * guess_kern_maxfiles())


def guess_kern_ipc_nmbclusters():
# You can't make this smaller
return max(sysctl_int('kern.ipc.nmbclusters'), 2 * MB)
Expand Down Expand Up @@ -240,10 +228,6 @@ def guess_net_inet_tcp_sendbuf_max():
return 16 * MB


def guess_vm_kmem_size():
return int(1.25 * HW_PHYSMEM)


def guess_vfs_zfs_arc_max():
""" Maximum usable scratch space for the ZFS ARC in secondary memory
Expand Down

0 comments on commit aa4f3da

Please sign in to comment.