For who might be interested my /etc/sysctl.conf

Code:
hw.snd.default_unit=4
hw.snd.feeder_rate_quality=3
hw.usb.no_shutdown_wait=1                #0  : No USB device waiting at system shutdown
kern.cam.scsi_delay=2000     # Delay (in ms) before probing SCSI
kern.corefile=/var/coredumps/%U/%N.core  #%N.core
kern.dirdelay=5                          #29
kern.filedelay=7                         #30
kern.geom.label.disk_ident.enable=0
kern.geom.label.gptid.enable=0
kern.geom.label.ufsid.enable=0
kern.init_shutdown_timeout=180
kern.ipc.shm_allow_removed=1
kern.ipc.shm_use_phys=1                  #0  : Enable locking of shared memory pages in core
kern.ipc.shmall=512000                   #131072
kern.ipc.shmmax=1000000000               #536870912
kern.maxfiles=2600000
kern.maxfilesperproc=2400000
kern.maxvnodes=2000000
kern.metadelay=4                         #28
kern.msgbuf_show_timestamp=1             #0 show timestamp in messagebuf
kern.random.fortuna.minpoolsize=512
kern.randompid=1                         #0
kern.sched.preempt_thresh=120            #80
kern.shutdown.kproc_shutdown_wait=20     #60 : Max wait time (sec) to stop for each process
kern.shutdown.poweroff_delay=2000        #5000 : Delay before poweroff to write disk caches (msec)
net.inet.icmp.icmplim=50                 #200
net.inet.ip.maxfragpackets=0             #15762
net.inet.ip.maxfragpackets=0             #15762
net.inet.ip.maxfragsperpacket=0          #16
net.inet.ip.maxfragsperpacket=0          #16
net.inet.ip.portrange.first=10000
net.inet.ip.portrange.last=65535
net.inet.ip.portrange.randomized=1
net.inet.ip.random_id=1                  #0                         
net.inet.ip.random_id=1                  #0                         
net.inet.tcp.cc.algorithm=cubic          #newreno #Congestion control newreno,CDG,CHD,CUBIC,DCTCP,HD,H-TCP,VEGAS
net.inet.tcp.drop_synfin=1
net.inet6.ip6.accept_rtadv=1             #0 Default value of per-interface flag for accepting ICMPv6 RA messages
net.inet6.ip6.prefer_tempaddr=1
net.inet6.ip6.temppltime=7200            # 86400 ,  Maximum preferred lifetime for temporary addresses
net.inet6.ip6.tempvltime=14400           # 604800 , Maximum valid lifetime for temporary addresses
net.inet6.ip6.use_tempaddr=1
net.local.stream.recvspace=65536
net.local.stream.sendspace=65536
security.bsd.unprivileged_idprio=1
security.jail.allow_raw_sockets=1
security.jail.chflags_allowed=1
vfs.usermount=1                          #0,Unprivileged users may mount and unmount file systems
vfs.zfs.arc_max= 8000000000              #0
vfs.zfs.arc_min= 2000000000              #0
vfs.zfs.min_auto_ashift=12               #9
vfs.zfs.txg.timeout=5
vm.cluster_anon=1

Comments are welcome.
 
I never knew that end-of-line comments were allowed. Now I see. Thanks!

sysctl.conf(5)

Since PulseAudio became risk-free (thanks to the improvements in base), I'll probably cease setting hw.snd.default_unit.

What's your use case for vfs.zfs.arc_max and vfs.zfs.arc_min?

Why 120 for kern.sched.preempt_thresh? I know it's popular to raise this, but I never noticed any effect from varying from the default (48 here).
 
kern.sched.preempt_thresh should give more responsive desktop system. [I.e. less for server].
vfs.zfs.arc_max i have set to 1/4 of my free memory.
vfs.zfs.arc_min is not that usefull.
 
On 13.x, setting kern.sched.preempt_thresh to 120 seemed to help reduce stalls on playing multiple videos simultaneously for my hardware; perhaps slightly better apparent responsivness in X switching windows and such.

On 14.0, didn't seem make any difference for me, so I left it at default 48.

arc_max: I go back and forth on this. I understand and agree with the theory since reclaiming ARC is not instantaneous, but I think a lot has to do with how much physical memory you have and your usage pattern. My opinion is it's likely more useful on say a system with 4G than on a system with 16G.

Over the years I feel FreeBSD has gotten better at default tuning for average use on average systems.
Low memory systems, limited resources, high memory, lots of resources serving lots of things all may benefit from analysis and intelligent tuning. Don't just blindly copy things you find on the Internet.

zfs-stats is very good to analyze your ZFS memory usage, helps you decide if you need to tune.
My sysctl.conf has been trimmed to things related to security, counters, idle and anything related to CVEs.
Of course has the obligatory:
vfs.zfs.min_auto_ashift=12
which is a leftover from when ZFS was first imported back in the 8.x or 9.x days. And yes I realize it's probably not needed anymore.
I may as well include what I set
security.bsd.see_other_uids=0 security.bsd.see_other_gids=0 kern.randompid=1 net.inet.tcp.blackhole=2 net.inet.udp.blackhole=1 net.inet.icmp.drop_redirect=1 net.inet.icmp.log_redirect=0 net.local.stream.recvspace=65536 net.local.stream.sendspace=65536 net.inet.tcp.cc.algorithm=cubic vfs.zfs.min_auto_ashift=12 kern.timecounter.hardware="HPET" machdep.idle=mwait
 
Back
Top