当前位置:网站首页>Istio Troubleshooting: uneven grpc service load
Istio Troubleshooting: uneven grpc service load
2022-06-24 12:43:00 【imroc】
This article excerpts from istio Learning notes
The phenomenon
grpc call , The same client Your request always hits the same server Of pod, Cause uneven load .
analysis
grpc Is based on http2 Long connection of , Multiple requests to reuse the same connection . If not istio, Use only ordinary k8s service, Will not perceive grpc Agreed , Just as tcp To forward , Load balancing at the connection level , No load balancing at the request level . But in istio in , The default will be for grpc Load balancing at the request level , If uneven load is found , It is usually not configured correctly .
Must let grpc Load balancing at the request level , The core is to let istio Correct identification is grpc agreement , Don't configure it to tcp, use tcp Then load balancing can only be performed at the connection level , Request levels can be loaded unevenly .
resolvent
- If you want to be exposed ,gateway in protocal To configure GRPC no need TCP, Example :
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata: name: grpc-gw namespace: demo spec: selector: app: istio-ingressgateway istio: ingressgateway servers: - hosts: - '*' port: name: grpc-demo-server number: 9000 protocol: GRPC # Use here GRPC no need TCP
- If you define vs, Need to use http Match without tcp, because grpc stay istio Chinese matching is also used http Field , Example :
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: grpc-svc namespace: demo spec: gateways: - demo/grpc-gw hosts: - '*' http: # Use here http no need tcp - match: - port: 9000 route: - destination: host: grpc.demo.svc.cluster.local port: number: 9000 weight: 100
- Deploying services service Of port name Need to use "grpc-" Opening definition , Give Way istio Be able to correctly identify , Example :
apiVersion: v1 kind: Service metadata: name: grpc namespace: demo spec: ports: - name: grpc-9000 # With grpc- start port: 9000 protocol: TCP targetPort: 9000 selector: app: grpc type: ClusterIP
For more protocol specification methods, please refer to istio Best practices : Explicitly specify the protocol for the service
边栏推荐
- How to evaluate software development projects reasonably?
- OpenGL es shared context for multi-threaded rendering
- Programmer: after 5 years in a company with comfortable environment, do you want to continue to cook frogs in warm water or change jobs?
- Chenglixin research group of Shenzhen People's hospital proposed a new method of multi group data in the diagnosis and prognosis analysis of hepatocellular carcinoma megps
- Is it safe to apply for new bonds to open an account
- It's settled! Bank retail credit risk control just does it!
- Opencv learning notes - Discrete Fourier transform
- Cloud native database: the outlet of the database, you can also take off
- The solution of distributed system: directory, message queue, transaction system and others
- [live broadcast of celebrities] elastic observability workshop
猜你喜欢
《回归故里》阅读笔记
一文讲透植物内生菌研究怎么做 | 微生物专题
Installation and operation of libuv
【数据挖掘】期末复习(样卷题目+少量知识点)
从《梦华录》的争议性,谈谈数字版权作品的价值泡沫
Cloud native database: the outlet of the database, you can also take off
Dingding, Feishu, and enterprise wechat: different business approaches
Codereview tool chain for micro medicine
Reading notes of returning to hometown
QT -- the qtabwidget supports dragging tabbar items
随机推荐
Detailed explanation of the execution order of the expression and loop body in the for loop
Is it safe to open an account for how many new bonds you can apply for
[tke] GPU node NVIDIA Tesla driver reinstallation
Five minutes to develop your own code generator
A good habit that makes your programming ability soar
[redisson] analysis of semaphore lock source code
How does Argo family bucket make Devops easier?
QT -- the qtabwidget supports dragging tabbar items
On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
Practice of dynamic load balancing based on open source tars
The pod is evicted due to insufficient disk space of tke node
[programming navigation] the practical code summarized by foreign great God, learned in 30 seconds!
Google hacking search engine attack and Prevention
Tencent released credit risk control results safely: it has helped banks lend more than 100 billion yuan
Clickhouse uses distributed join of pose series
Pinduoduo press the user accelerator key
Continuous testing | test process improvement: practice continuous testing within iterations in coding
Automatic reconstruction of pod after modifying resource object
Coinbase will launch the first encrypted derivative product for retail traders
Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme