File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,14 @@ set_defaults() {
381
381
} 2> /dev/null
382
382
fi
383
383
384
+ # check RAM capacity, use performance optimization policy for nftables sets if RAM>=2048MiB
385
+ nft_perf_def=memory
386
+ IFS=' : ' read -r _ memTotal _ < /proc/meminfo 2> /dev/null
387
+ case " $memTotal " in
388
+ ' ' |* ![0-9]* ) ;;
389
+ * ) [ $memTotal -ge 2097152 ] && nft_perf_def=performance
390
+ esac
391
+
384
392
: " ${nobackup:= " $nobackup_def " } "
385
393
: " ${datadir:= " $datadir_def " } "
386
394
: " ${schedule:= " 15 4 * * *" } "
@@ -389,7 +397,7 @@ set_defaults() {
389
397
: " ${_fw_backend:= " $_fw_backend_def " } "
390
398
: " ${tcp_ports:= skip} "
391
399
: " ${udp_ports:= skip} "
392
- : " ${nft_perf:= memory } "
400
+ : " ${nft_perf:= $nft_perf_def } "
393
401
: " ${reboot_sleep:= 30} "
394
402
: " ${max_attempts:= 30} "
395
403
}
You can’t perform that action at this time.
0 commit comments