I'm doing load test for 30000TPS(transaction per second) using gatling, I facing the following error
i.n.c.u.Errors$NativeIoException: newSocketStream(..) failed: 99128 (99.43%) Too many open files > j.n.ConnectException: connect(..) failed: Cannot assign reques 570 ( 0.57%) ted address
Seems I'm running out of TCP ports in my load test VM'
I tried tuning the kernel configuration in /etc/sysctl.conf.
net.ipv4.tcp_max_syn_backlog = 40000
net.core.somaxconn = 40000
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_mem = 134217728 134217728 134217728
net.ipv4.tcp_rmem = 4096 277750 134217728
net.ipv4.tcp_wmem = 4096 277750 134217728
net.core.netdev_max_backlog = 300000
net.ipv4.ip_local_port_range=1025 65535
Also configured ulimit -n 65k but no luck, still I struck on tcp connections issues.
Anyone could you please advise me how we can reuse the tcp ports fastly..
Reference :
ran out of tcp udp ports [closed] - https://serverfault.com › questions › ran-out-of-tcp-udp...