istio-ingressgateway 和 istio-proxy 在 keepalive 方面如何?

问题描述 投票:0回答:1

我试图了解 istio-ingressgateway 和 istio-proxy 如何与 keepalive 配合使用。

  1. istio-ingressgateway
  • 默认情况下,istio ingressgateway 似乎没有任何 keepalive,我发现可以使用 EnvoyFilter 来打开它。为什么 keepalive 默认关闭?
  • 我在 istio ingressgateway 前面有 ALB。我应该在 istio ingressgateway 中打开 keepalive 以获得更好的性能吗?
  1. istio 代理
  • istio-proxy keepalive 是如何工作的?例如,我有一个配置了 istio-proxy sidecar 的应用程序 pod。在 istio-proxy 容器中运行 netstat,我过滤了目标端口 3306 (mysql) 的套接字。我看到绑定到应用程序的套接字已配置保持活动。但是,绑定到 istio-proxy 的套接字似乎没有配置 keepalive(请参见下面的结果)。传出请求将具有应用程序 -> istio-proxy -> mysql 的网络跃点。下面的结果是否意味着 application -> istio-proxy 有 keepalive,但 istio-proxy -> mysql 没有 keepalive? (我没有配置 DestinationRule)
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)
sockets istio istio-gateway tcp-keepalive
1个回答
0
投票

您混淆了 TCP keepalive 和 HTTP keepalive。

  • TCP keepalive 是检测空闲连接中的连接丢失。它与性能完全无关。这就是 netstat 输出中显示的内容。
  • HTTP keeplive 是针对多个 HTTP/1 请求重用相同的底层 TCP 连接(与 HTTP/2 和 HTTP/3 无关)。这会影响性能。

HTTP keepalive 仅与 HTTP/1 连接相关,即与您的 mysql 流量无关。 TCP keepalive 与你的 mysql 流量相关,但与性能无关。所以对 mysql 进行调整并没有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.