我试图了解 istio-ingressgateway 和 istio-proxy 如何与 keepalive 配合使用。
istio-proxy@api-server-78546676ff-jmz7n:/$ netstat -napot | grep :3306
tcp 0 0 10.2.59.79:44666 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:35796 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:53726 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:38004 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:37970 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:45754 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:37980 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:45766 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:35578 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:48336 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:60982 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:46468 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:53656 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:42940 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:37938 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:54056 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:52402 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:43016 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:33462 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:40306 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:37786 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:55524 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:43272 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:58828 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:38590 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:33442 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:35348 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:34652 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:43446 10.2.87.210:3306 TIME_WAIT - timewait (53.17/0/0)
tcp 0 0 10.2.59.79:37988 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp 0 0 10.2.59.79:48448 10.2.87.210:3306 ESTABLISHED 24/envoy off (0.00/0/0)
tcp6 0 0 10.2.59.79:37956 10.2.87.210:3306 ESTABLISHED - keepalive (6565.21/0/0)
tcp6 0 0 10.2.59.79:33440 10.2.87.210:3306 ESTABLISHED - keepalive (6628.60/0/0)
tcp6 0 0 10.2.59.79:43440 10.2.87.210:3306 TIME_WAIT - timewait (53.17/0/0)
tcp6 0 0 10.2.59.79:43266 10.2.87.210:3306 ESTABLISHED - keepalive (5580.06/0/0)
tcp6 0 0 10.2.59.79:37974 10.2.87.210:3306 ESTABLISHED - keepalive (6566.74/0/0)
tcp6 0 0 10.2.59.79:43008 10.2.87.210:3306 ESTABLISHED - keepalive (5876.89/0/0)
tcp6 0 0 10.2.59.79:46464 10.2.87.210:3306 ESTABLISHED - keepalive (6003.36/0/0)
tcp6 0 0 10.2.59.79:37996 10.2.87.210:3306 ESTABLISHED - keepalive (6574.42/0/0)
tcp6 0 0 10.2.59.79:37982 10.2.87.210:3306 ESTABLISHED - keepalive (6568.31/0/0)
tcp6 0 0 10.2.59.79:45752 10.2.87.210:3306 ESTABLISHED - keepalive (7193.17/0/0)
tcp6 0 0 10.2.59.79:44660 10.2.87.210:3306 ESTABLISHED - keepalive (5714.30/0/0)
tcp6 0 0 10.2.59.79:37778 10.2.87.210:3306 ESTABLISHED - keepalive (6261.88/0/0)
tcp6 0 0 10.2.59.79:55508 10.2.87.210:3306 ESTABLISHED - keepalive (6510.68/0/0)
tcp6 0 0 10.2.59.79:42934 10.2.87.210:3306 ESTABLISHED - keepalive (6758.30/0/0)
tcp6 0 0 10.2.59.79:54054 10.2.87.210:3306 ESTABLISHED - keepalive (5967.71/0/0)
tcp6 0 0 10.2.59.79:48440 10.2.87.210:3306 ESTABLISHED - keepalive (6667.33/0/0)
tcp6 0 0 10.2.59.79:35564 10.2.87.210:3306 ESTABLISHED - keepalive (6494.90/0/0)
tcp6 0 0 10.2.59.79:60972 10.2.87.210:3306 ESTABLISHED - keepalive (6313.46/0/0)
tcp6 0 0 10.2.59.79:40304 10.2.87.210:3306 ESTABLISHED - keepalive (6425.69/0/0)
tcp6 0 0 10.2.59.79:35780 10.2.87.210:3306 ESTABLISHED - keepalive (5678.33/0/0)
tcp6 0 0 10.2.59.79:35338 10.2.87.210:3306 ESTABLISHED - keepalive (5914.68/0/0)
tcp6 0 0 10.2.59.79:37926 10.2.87.210:3306 ESTABLISHED - keepalive (6519.52/0/0)
tcp6 0 0 10.2.59.79:53712 10.2.87.210:3306 ESTABLISHED - keepalive (6544.57/0/0)
tcp6 0 0 10.2.59.79:53640 10.2.87.210:3306 ESTABLISHED - keepalive (6525.79/0/0)
tcp6 0 0 10.2.59.79:52388 10.2.87.210:3306 ESTABLISHED - keepalive (6091.58/0/0)
tcp6 0 0 10.2.59.79:58822 10.2.87.210:3306 ESTABLISHED - keepalive (6069.28/0/0)
tcp6 0 0 10.2.59.79:33456 10.2.87.210:3306 ESTABLISHED - keepalive (6629.91/0/0)
tcp6 0 0 10.2.59.79:38582 10.2.87.210:3306 ESTABLISHED - keepalive (6032.44/0/0)
tcp6 0 0 10.2.59.79:45758 10.2.87.210:3306 ESTABLISHED - keepalive (6687.26/0/0)
tcp6 0 0 10.2.59.79:48332 10.2.87.210:3306 ESTABLISHED - keepalive (6592.42/0/0)
tcp6 0 0 10.2.59.79:34650 10.2.87.210:3306 ESTABLISHED - keepalive (6472.32/0/0)
您混淆了 TCP keepalive 和 HTTP keepalive。
HTTP keepalive 仅与 HTTP/1 连接相关,即与您的 mysql 流量无关。 TCP keepalive 与你的 mysql 流量相关,但与性能无关。所以对 mysql 进行调整并没有帮助。