# loadavg and HZ https://github.com/torvalds/linux/blob/master/kernel/sched/loadavg.c#L320-L322 從 linux 原始碼上面可以看到這三行 ``` avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); ``` ## HZ 透過以下指令可以知道 kernel HZ 的設定值 ``` grep 'CONFIG_HZ=' /boot/config-$(uname -r) ``` 預設直目前大多還是 250 https://lwn.net/Articles/145973/ # Reference - https://www.slideshare.net/brendangregg/what-linux-can-learn-from-solaris-performance-and-viceversa/2-Linux_vs_Solaris_Performance_DifferencesDTrace - https://unix.stackexchange.com/questions/74713/how-frequently-is-the-proc-file-system-updated-on-linux?rq=1 - https://unix.stackexchange.com/questions/90627/notify-of-changes-on-a-file-under-proc - http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html (reading tag : What is a "good" or "bad" load average?) - https://www.helpsystems.com/resources/guides/unix-load-average-part-1-how-it-works