proc_optimizations () {
{ printf "4194304" > /proc/sys/kernel/pid_max; }; # Ensure max PID coverage
{ printf "2" > /proc/sys/vm/overcommit_memory; }; # Ensure ratio algorithm checks properly work including swap.
{ printf "2500000" > /proc/sys/net/core/rmem_max; }; # Ensure UDP receive buffer set to 2.5M.
{ printf "0" > /proc/sys/net/ipv4/icmp_ratelimit; }; # Ensure Control over MTRS
{ printf "256" > /proc/sys/net/ipv4/neigh/default/gc_thresh1; }; # Increase ARP cache sizes and GC thresholds
{ printf "1024" > /proc/sys/net/ipv4/neigh/default/gc_thresh2; }; # Increase ARP cache sizes and GC thresholds
{ printf "2048" > /proc/sys/net/ipv4/neigh/default/gc_thresh3; }; # Increase ARP cache sizes and GC thresholds
{ printf "240" > /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_max_retrans; }; # Lower conntrack tcp_timeout_max_retrans from 300 to 240
if [ -n "$(nvram get ipv6_service)" ]; then #IPV6 proc variants
{ printf "0" > /proc/sys/net/ipv6/icmp/ratelimit; };
{ printf "256" > /proc/sys/net/ipv6/neigh/default/gc_thresh1; };
{ printf "1024" > /proc/sys/net/ipv6/neigh/default/gc_thresh2; };
{ printf "2048" > /proc/sys/net/ipv6/neigh/default/gc_thresh3; };
fi;
}