Istio 入口网关随机 returns 507 响应
Istio ingress gateway randomly returns 507 response
如果上游 returns 502,入口网关正在重试。大部分时间它都按预期工作。有时网关 returns 507“重试上游时超出请求缓冲区限制”而没有重试。
从日志中我可以看到:app 502
-> istio-proxy sidecar 502
-> ingress gateway 507
-> client
。无法在与 ingress-gateway
.
相关的日志中找到其他错误
请求的大小为 1-30Mb。有什么想法可以在哪里寻找问题吗?
虚拟服务:
...
retries:
attempts: 4
retryOn: 502,retriable-status-codes,connect-failure
retryRemoteLocalities: true
...
特使过滤器:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: buffer-limit
spec:
configPatches:
- applyTo: LISTENER
listenerMatch: 0.0.0.0_8080
patch:
operation: MERGE
value:
per_connection_buffer_limit_bytes: 100000000
解决方案是使用正确的 Envoy 过滤器:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
namespace: istio-system
name: buffer-limit
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: LISTENER
patch:
operation: MERGE
value:
per_connection_buffer_limit_bytes: 100000000
过滤器适用于 v1.8.4
检查是否应用过滤器:
istioctl proxy-config listeners <istio-ingressgateway-pod> -o json -n istio-system
如果上游 returns 502,入口网关正在重试。大部分时间它都按预期工作。有时网关 returns 507“重试上游时超出请求缓冲区限制”而没有重试。
从日志中我可以看到:app 502
-> istio-proxy sidecar 502
-> ingress gateway 507
-> client
。无法在与 ingress-gateway
.
请求的大小为 1-30Mb。有什么想法可以在哪里寻找问题吗?
虚拟服务:
...
retries:
attempts: 4
retryOn: 502,retriable-status-codes,connect-failure
retryRemoteLocalities: true
...
特使过滤器:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: buffer-limit
spec:
configPatches:
- applyTo: LISTENER
listenerMatch: 0.0.0.0_8080
patch:
operation: MERGE
value:
per_connection_buffer_limit_bytes: 100000000
解决方案是使用正确的 Envoy 过滤器:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
namespace: istio-system
name: buffer-limit
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: LISTENER
patch:
operation: MERGE
value:
per_connection_buffer_limit_bytes: 100000000
过滤器适用于 v1.8.4
检查是否应用过滤器:
istioctl proxy-config listeners <istio-ingressgateway-pod> -o json -n istio-system