Set cannot assign requested address (Address not available) under linux.
A lot of errors occurred when jmeter did load testing under linux.
(1) View the number of default ports:
ulimit -n
default 1024
(2) Modify the number of ports:
decrease -n 65535
(3) Check whether the tcp port range of the available ports of the load machine is within a reasonable range:
cat /proc/sys/net/ipv4/ip_local_port_range
If not, modify it. Command:
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
(4) Reduce the waiting time after the port is released, the default is 60s, modify it to 15~30s. Order:
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
(5) Modify the tcp/ip protocol configuration, by configuring /proc/sys/net/ipv4/tcp_tw_resue, the default is 0, modify it to 1, and release the TIME_WAIT port for new connections.
Command:
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
(6) Modify the tcp/ip protocol configuration to quickly recover socket resources. The default is 0, and it is changed to 1.
Home:
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
(7) Temporary configuration takes effect immediately:
sysctl -p。
(8) If the machine is rebooted, the configuration will become invalid and need to be reconfigured.
Expansion: can be modified in other ways: cd /proc/sys/net/ipv4/ vim tcp_tw_reuse
4. Check port under linux
(1) View port: netstat -tuln
(2) View details: netstat