Hi all,
Istio Proxy: 1.15.3
I am trying to figure out how number of opened connections/sockets between gRPC client and server is determined in Istio mesh.
The following client will open 8 connections, I guess this is driven by concurrency parameter as per source code: istio/inject.go at 1.15.3 · istio/istio · GitHub, however server can only see one connection. I tried setting different concurrency and cpu hoping it would increase number of server connections, however the results were never deterministic. For completeness, I included Virtual Service and Destination Rule.
Client:
apiVersion: batch/v1
kind: Job
metadata:
annotations:
name: client
spec:
template:
metadata:
annotations:
proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true, "concurrency": 8 }'
sidecar.istio.io/inject: "true"
sidecar.istio.io/proxyCPU: "4"
sidecar.istio.io/proxyCPULimit: "4"
sidecar.istio.io/proxyMemory: 1Gi
sidecar.istio.io/proxyMemoryLimit: 1Gi
spec:
containers:
- image: dummy:latest
imagePullPolicy: IfNotPresent
name: dummy
resources:
limits:
cpu: "4"
memory: 4Gi
requests:
cpu: "4"
memory: 4Gi
Server:
apiVersion: apps/v1
kind: Deployment
metadata:
name: server
spec:
replicas: 1
selector:
matchLabels:
app: server
strategy:
rollingUpdate:
maxSurge: 5%
maxUnavailable: 100%
type: RollingUpdate
template:
metadata:
annotations:
proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'
sidecar.istio.io/inject: "true"
spec:
containers:
- image: server:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- /bin/grpc_health_probe
- -addr=:9999
- -service=liveness
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 20
name: server
readinessProbe:
exec:
command:
- /bin/grpc_health_probe
- -addr=:9999
failureThreshold: 5
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: "3"
memory: 2Gi
requests:
cpu: "3"
memory: 2Gi
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: server
spec:
hosts:
- server
http:
- name: server
route:
- destination:
host: server
port:
number: 9999
headers:
request:
remove:
- grpc-accept-encoding
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: server
spec:
host: server
trafficPolicy:
loadBalancer:
simple: LEAST_REQUEST
apiVersion: v1
kind: Service
metadata:
name: server
spec:
ports:
- name: grpc
port: 9999
protocol: TCP
targetPort: grpc
selector:
app: server