IPV4中TCP内核参数

 

 

 

参照debian系统,查看的tcp相关配置

# 全连接队列满了,新来的连接发送rst, 1表示开启
net.ipv4.tcp_abort_on_overflow = 0
# 接受缓冲区1/2^n用来接受缓冲,换句话来说,接收窗口不表示接受buffer的大小
net.ipv4.tcp_adv_win_scale = 1
# 拥塞算法
net.ipv4.tcp_allowed_congestion_control = reno cubic

net.ipv4.tcp_app_win = 31
# 自动开启crok选项
net.ipv4.tcp_autocorking = 1
net.ipv4.tcp_available_congestion_control = reno cubic
net.ipv4.tcp_available_ulp = 
net.ipv4.tcp_base_mss = 1024
net.ipv4.tcp_challenge_ack_limit = 1000
net.ipv4.tcp_comp_sack_delay_ns = 1000000
net.ipv4.tcp_comp_sack_nr = 44
net.ipv4.tcp_congestion_control = cubic
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_early_demux = 1
net.ipv4.tcp_early_retrans = 3
net.ipv4.tcp_ecn = 2
net.ipv4.tcp_ecn_fallback = 1
net.ipv4.tcp_fack = 0
# fast_open 快速打开选项
net.ipv4.tcp_fastopen = 1
net.ipv4.tcp_fastopen_blackhole_timeout_sec = 3600
net.ipv4.tcp_fastopen_key = 00000000-00000000-00000000-00000000
# FIN-WAIT-2状态的时间
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_frto = 2
net.ipv4.tcp_fwmark_accept = 0
net.ipv4.tcp_invalid_ratelimit = 500
# keepalive 默认配置
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_l3mdev_accept = 0
net.ipv4.tcp_limit_output_bytes = 262144
net.ipv4.tcp_low_latency = 0
net.ipv4.tcp_max_orphans = 8192
net.ipv4.tcp_max_reordering = 300
# 半连接队列大小
net.ipv4.tcp_max_syn_backlog = 128
# time_wait数量
net.ipv4.tcp_max_tw_buckets = 8192
# 
net.ipv4.tcp_mem = 22512	30016	45024
net.ipv4.tcp_min_rtt_wlen = 300
net.ipv4.tcp_min_snd_mss = 48
net.ipv4.tcp_min_tso_segs = 2
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_mtu_probing = 0
net.ipv4.tcp_no_metrics_save = 0
net.ipv4.tcp_notsent_lowat = 4294967295
net.ipv4.tcp_orphan_retries = 0
net.ipv4.tcp_pacing_ca_ratio = 120
net.ipv4.tcp_pacing_ss_ratio = 200
net.ipv4.tcp_probe_interval = 600
net.ipv4.tcp_probe_threshold = 8
net.ipv4.tcp_recovery = 1
net.ipv4.tcp_reordering = 3
net.ipv4.tcp_retrans_collapse = 1
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_retries2 = 15
net.ipv4.tcp_rfc1337 = 0
# recv buffer
net.ipv4.tcp_rmem = 4096	87380	6291456
# tcp改进的拥塞机制
net.ipv4.tcp_sack = 1
net.ipv4.tcp_slow_start_after_idle = 1
net.ipv4.tcp_stdurg = 0
# 第一次握手重试次数
net.ipv4.tcp_syn_retries = 6
# 第一次握手重试次数
net.ipv4.tcp_synack_retries = 5
# 开启syncookies选项,放syn攻击
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_thin_linear_timeouts = 0
# 时间戳小的会忽略
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tso_win_divisor = 3
# 只对客户端起作用,服务器还是要用so_reuseaddr
net.ipv4.tcp_tw_reuse = 2
# 滑动窗口大于64K的时候需要开启此值
net.ipv4.tcp_window_scaling = 1
# 发送缓冲区buffer
net.ipv4.tcp_wmem = 4096	16384	4194304
net.ipv4.tcp_workaround_signed_windows = 0
net.ipv4.udp_early_demux = 1
net.ipv4.udp_l3mdev_accept = 0
net.ipv4.udp_mem = 45024	60033	90048
net.ipv4.udp_rmem_min = 4096
net.ipv4.udp_wmem_min = 4096
net.ipv4.xfrm4_gc_thresh = 32768

 

 

 

THE END
分享
二维码
< <上一篇
下一篇>>