MySQL-, , :
localhost:12345 -> mysqlserver:3306
, TIME_WAIT. - TCP . TIME_WAIT . TIME_WAIT .
, mysql , TIME_WAIT. .
, , . - 60 . , 400 .
:
. TIME_WAIT ( Linux):
TIME_WAIT:
echo 15 > /proc/sys/net/ipv4/tcp_fin_timeout
:
echo 15000 65000 > /proc/sys/net/ipv4/ip_local_port_range
/proc/sys/net/ipv4/tcp_tw_recycle /proc/sys/net/ipv4/tcp_tw_reuse. ( , . )
.
Some programming languages and libraries support persistent connections. Another solution might be to use a locally installed proxy server, such as ProxySQL. This reduces the number of new and closed connections.
source
share