开启负载均衡SLB后ECS存在大量TIMEWAIT的内网80端口连接
Re开启负载均衡SLB后ECS存在大量TIMEWAIT的内网80端口连接
我也遇到这个问题了,不知道如何解决
开启负载均衡SLB后ECS会存在大量TIMEWAIT的内网80端口连接(几秒内升到2W预设值),不知道如何解决,不走SLB通过另一个ECS压力测试时,仅会出现极少量(低于500)的TIMEWAIT
ECS的sysctl.conf配置如下:
net.ipv4.ip_forward = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.neigh.default.gc_stale_time = 120
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_tw_buckets = 20000
net.core.somaxconn = 81920
net.core.netdev_max_backlog = 81920
net.ipv4.tcp_max_syn_backlog = 81920
net.ipv4.tcp_synack_retries = 3
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
压力测试命令为:
ab -k -c10000 -n400000 url
-------------------------
Re开启负载均衡SLB后ECS存在大量TIMEWAIT的内网80端口连接
目前SLB服务器的机器访问ECS全部采用的是http 1.0短链接协议,而真实用户访问SLB时采用的是http 1.1,经过SLB服务器中转之后变为了http 1.0,我猜这是导致大量TIME_WAIT的一个主要原因!
赞0
踩0