Maximum kern.hz ?

Can someone tell me what is the maximum allowed value for kern.hz?

Right now I am running it on 2000, what will happen if I set it on 4000?

I have 3 GHz CPU.
 
DigiSoft said:
Right now I am running it on 2000, what will happen if I set it on 4000?
Earth might blow up.

I'd keep it at 1000 (the default since 8.0), at most. Why did you even set it to 2000?
 
Set it too high, and the kernel will do nothing but service timer interrupts. :)

Timer interrupts fire every 1/HZ seconds. IOW, if you set it to 4000, then 4000 timer interrupts will fire every second.
 
I think I agree with SirDice, keep moving it up until it stops helping. Or as we used to say in the shop: Turn it till it strips and then back it off half a turn.
 
Is there any chance you have enabled polling for your network card(s)?
If so, might want to look into disabling polling, which would make the CPU be interrupted to process network data whenever there's any, as opposed to being interrupted extremely often even when there's nothing waiting. :)
 
Ok but on 2000 my Gaming server was producing 500 FPS and on 4000 it produces about 800 and the lag is lowered.
At default kern.hz=1000, glxgears was around 4000

sysctl -a | grep kern.hz had this:
Code:
kern.hz_min: 8
kern.hz_max: 137438
kern.hz: 1000

kern.hz=137438 rebooted fine and glxgears does 7000 😲

I'm on 16.0-CURRENT with Skylake i5-6400T (Intel HD 530)
 
"vmstat -i" will show you total interrupts and rate for various devices. On a pi3 I see things like these!
Code:
interrupt                                             total       rate
lintc0,1:-ic_timer0                                  945529       1156
lintc0,8: intc0                                    13108691      16020
intc0,17:-x_dwcotg0                                19575428      23923
 
Nice! I have this with kern.hz=137438 and a little over 1 hour uptime:
Code:
interrupt                          total       rate
irq9: acpi0                            5          0
cpu0:timer                     701622170     129707
cpu1:timer                     700936588     129581
cpu2:timer                     707566009     130806
cpu3:timer                     701306144     129649
irq128: xhci0                      99302         18
irq129: ahci0                      54011         10
irq130: re0                        49151          9
irq131: hdac0                       3227          1
irq132: vgapci0                  5069690        937
irq133: iwlwifi0                      10          0
irq138: iwlwifi0                       2          0
Total                         2816706309     520719

CPU timer rates looks close to 137k (kern.hz_max), so if it isn't limited by that, maybe kern.hz should be set slightly-higher than whatever has the highest rate?

If VGA was around 900 and kern.hz was 1000, would the hz at 1000 be limiting overall perf if other stuff (4x cpu timers) was occurring too?
 
Back
Top