#!/bin/bash
echo "26214400" > /proc/sys/net/ipv4/netfilter/ip_conntrack_max
echo "600" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
echo "60" > /proc/sys/net/ipv4/netfilter/ip_conntrack_generic_timeout
echo "30" > /proc/sys/net/ipv4/netfilter/ip_conntrack_icmp_timeout
echo "10" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_close_wait
echo "15" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_fin_wait
echo "15" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_last_ack
echo "15" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_max_retrans
echo "15" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_syn_recv
echo "20" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_syn_sent
echo "10" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_time_wait
echo "20" > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout
echo "120" > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream
echo "600" > /proc/sys/net/ipv4/tcp_keepalive_time
echo "1" > /proc/sys/net/ipv4/tcp_ecn
echo "1" > /proc/sys/net/ipv4/tcp_fack
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "3" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "1" > /proc/sys/net/ipv4/tcp_low_latency
echo "32768" > /proc/sys/net/ipv4/tcp_max_orphans
echo "32768" > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo "100000" > /proc/sys/net/ipv4/tcp_max_tw_buckets
echo "3" > /proc/sys/net/ipv4/tcp_orphan_retries
echo "5" > /proc/sys/net/ipv4/tcp_reordering
echo "2" > /proc/sys/net/ipv4/tcp_retries1
echo "10" > /proc/sys/net/ipv4/tcp_retries2
echo "1" > /proc/sys/net/ipv4/tcp_rfc1337
echo "1" > /proc/sys/net/ipv4/tcp_sack
echo "1" > /proc/sys/net/ipv4/tcp_syn_retries
echo "1" > /proc/sys/net/ipv4/tcp_synack_retries
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "1" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
echo "0" > /proc/sys/net/ipv4/ip_forward
echo "0" > /proc/sys/net/ipv4/tcp_low_latency
echo "873200" > /proc/sys/net/core/rmem_max
echo "873200" > /proc/sys/net/core/wmem_max
echo "4096 8388608 16777216" > /proc/sys/net/ipv4/tcp_wmem
echo "4096 8388608 16777216" > /proc/sys/net/ipv4/tcp_rmem
echo "41943040 41943040 41943040" > /proc/sys/net/ipv4/tcp_mem
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo "1024000000" > /proc/sys/kernel/shmmax
echo "32768" > /proc/sys/net/core/netdev_max_backlog
echo "32768" > /proc/sys/net/core/somaxconn
echo "13107200" > /proc/sys/fs/file-max
echo "1024 65000" > /proc/sys/net/ipv4/ip_local_port_range

One thought on “胡乱优化Linux”

发表评论

电子邮件地址不会被公开。 必填项已用*标注