Open source software supply chain lighting plan, waiting for you>>>
At the beginning of today’s stress test, there were many exceptions, all of which were java.net.noroutetohostexception: cannot assign requested address
According to the information on the Internet, it is due to the exhaustion of the client connection port allocated by Linux and the failure to establish a socket connection. Although the socket is normally closed, the port is not released immediately, but is in time_ Wait state, wait for 60s by default before releasing.
Check the range of client connection ports supported by Linux, that is, 28232 ports
cat /proc/sys/net/ipv4/ip_ local_ port_ range
32768 – 61000
resolvent:
1. Reduce the waiting time after port release, which is 60 s by default and 15 ~ 30 s by modification
echo 30 >/proc/sys/net/ipv4/tcp_ fin_ timeout
2. Modify the TCP/IP protocol configuration by configuring/proc/sys/net/IPv4/TCP_ tw_ Reset, default to 0, modify to 1, release time_ The wait port is used for new connections.
echo 1 >/proc/sys/net/ipv4/tcp_ tw_ reuse
3. Modify the TCP/IP protocol configuration to recycle socket resources quickly. The default value is 0 and the value is 1
echo 1 >/proc/sys/net/ipv4/tcp_ tw_ recycle
Through the above three adjustments, the pressure test runs normally.
Similar Posts:
- Execute the Jmeter Script Error: .org.apache.http.conn.httphostconnectexception: XXXX failed: unable to specify the solution of the requested address (Connect failed)
- Java.net.noroutetohostexception: cannot assign requested address
- [Solved] Nginx Error: connect() failed (110: Connection timed out) while connecting to upstream
- Programming udp sockets in python
- FileZilla 425 Can’t open data connection
- [Solved] 2003 – cant connect o mysql server on xxx (10060 unknown error)
- apr_socket_recv: Connection reset by peer (104)
- [How to Solve] nodejs mysql ER_NOT_SUPPORTED_AUTH_MODE
- Shell Syntax Error: operand expected (error token is “-”)
- Linux Script Example: iptables-nat.sh