当前位置:网站首页>Deeply understand the timeout setting of istio traffic management
Deeply understand the timeout setting of istio traffic management
2022-07-22 04:47:00 【Wanmao Society】
Environmental preparation
Deploy httpbin
service :
kubectl apply -f samples/httpbin/httpbin.yaml
Deploy sleep
service :
kubectl apply -f samples/sleep/sleep.yaml
httpbin
The service is the server that receives the request , sleep
The service is the client that sends the request .
Set timeout
stay sleep
Service oriented httpbin
Service sending request :
export SLEEP_POD=$(kubectl get pods -l app=sleep -o 'jsonpath={.items[0].metadata.name}')
kubectl exec "$SLEEP_POD" -c sleep -- time curl -o /dev/null -sS -w "%{http_code}\n" http://httpbin.org/delay/5
The results are as follows :
200
real 0m 5.69s
user 0m 0.00s
sys 0m 0.00s
You can see , The request is about 5 Seconds back 200 (OK).
Create virtual services , visit httpbin
The service , The request timeout is set to 3 second :
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- httpbin
http:
- route:
- destination:
host: httpbin
timeout: 3s
EOF
Visit again , The results are as follows :
504
real 0m 3.01s
user 0m 0.00s
sys 0m 0.00s
You can see , stay 3 Seconds later 504 (Gateway Timeout). Istio stay 3 Seconds later, the response time is 5 Of a second httpbin
Service request . Next , Let's take a closer look ,Istio How to cut off the request ?
see Envoy journal
Execute the order , see sleep
Service Envoy journal :
kubectl logs -l app=sleep -c istio-proxy
You can see sleep
The service is right httpbin
Log of service invocation :
{
"authority": "httpbin:8000",
"bytes_received": 0,
"bytes_sent": 24,
"connection_termination_details": null,
"downstream_local_address": "172.24.146.239:8000",
"downstream_remote_address": "172.24.158.25:40384",
"duration": 3001,
"method": "GET",
"path": "/delay/5",
"protocol": "HTTP/1.1",
"request_id": "5ef38816-7f49-48c8-9627-2416e1716293",
"requested_server_name": null,
"response_code": 504,
"response_code_details": "upstream_response_timeout",
"response_flags": "UT",
"route_name": null,
"start_time": "2022-07-01T09:40:13.882Z",
"upstream_cluster": "outbound|8000||httpbin.onemore.svc.cluster.local",
"upstream_host": "172.24.158.96:80",
"upstream_local_address": "172.24.158.25:32846",
"upstream_service_time": null,
"upstream_transport_failure_reason": null,
"user_agent": "curl/7.81.0-DEV",
"x_forwarded_for": null
}
among ,response_flags
by UT
, Upstream (upstream) request timeout , That is to say sleep
Service detected httpbin
The request for the service timed out .
Execute the order , see httpbin
Service Envoy journal :
kubectl logs -l app=httpbin -c istio-proxy
You can see httpbin
Service by sleep
Called by the service Envoy journal :
{
"authority": "httpbin:8000",
"bytes_received": 0,
"bytes_sent": 0,
"connection_termination_details": null,
"downstream_local_address": "172.24.158.96:80",
"downstream_remote_address": "172.24.158.25:32846",
"duration": 2997,
"method": "GET",
"path": "/delay/5",
"protocol": "HTTP/1.1",
"request_id": "5ef38816-7f49-48c8-9627-2416e1716293",
"requested_server_name": "outbound_.8000_._.httpbin.onemore.svc.cluster.local",
"response_code": 0,
"response_code_details": "downstream_remote_disconnect",
"response_flags": "DC",
"route_name": "default",
"start_time": "2022-07-01T09:40:13.885Z",
"upstream_cluster": "inbound|80||",
"upstream_host": "172.24.158.96:80",
"upstream_local_address": "127.0.0.6:35701",
"upstream_service_time": null,
"upstream_transport_failure_reason": null,
"user_agent": "curl/7.81.0-DEV",
"x_forwarded_for": null
}
among ,response_flags
by DC
, Means downstream (downstream) The connection is broken , That is to say sleep
The call request of the service was interrupted .
In depth analysis
adopt Envoy journal , We can make some analysis and judgment :
When httpbin
Service Request OK When , The calling process is as follows :
When httpbin
Service request timeout When , The calling process is as follows :
although , We are httpbin
The request timeout set on the service , But in fact, it is sleep
Service Envoy.
clear
kubectl delete virtualservice httpbin
kubectl delete -f samples/httpbin/httpbin.yaml
kubectl delete -f samples/sleep/sleep.yaml
Last , Thank you for being so handsome , Give it back to me. give the thumbs-up .
边栏推荐
- HCIP笔记整理 2022/7/17
- 实景三维渐成测绘大趋势,数据存储迎来新风口
- 巴比特 | 元宇宙每日必读:要求高级政府官员披露其在NFT上的所有投资?美国政府道德办公室发布的这份法律咨询还说了什么?...
- 专访SPORTFIVE李莹:如何用Web3的方式推动体育IP拓展“新商业版图”
- 尚品汇后台管理项目SPU模块和SKU模块的实现
- A simple exploration of Suricata
- There are always errors in installing plug-ins in NPM
- ORM学员管理系统单表查询示例
- Sdl2 concise tutorial (2): create an empty window
- window10任务栏操作
猜你喜欢
第七节 数据字典:Hash哈希 跟着大宇学Redis--------目录帖
Installation and use of yarn
Number of Islands vs maximum square
尚品汇后台管理项目SPU模块和SKU模块的实现
[FPGA tutorial case 33] communication case 3 - BPSK modulation signal generation based on FPGA, and its constellation is tested by MATLAB
Implementation of SPU module and SKU module of shangpinhui background management project
【FPGA教程案例33】通信案例3——基于FPGA的BPSK调制信号产生,通过matlab测试其星座图
4K投影仪为什么比1080P投影仪更值得买?答案显而易见!
eslint的命令行使用
Welcome to the CSDN markdown editor template
随机推荐
《安富莱嵌入式周报》第274期:2022.07.11--2022.07.17
多态,抽象类,接口
HOT100 word split
封装函数baseData.js
Matplotlib adjust legend related content
马斯克热搜体质无疑,称已将大脑上传云端,却遭网友热议!
PHP7.4使用composer报异常处理
Nested cross validation
JS how to control the position of the scroll bar of the whole page
go语言环境搭建和样例
Qt之使用QTreeView实现QQ登录好友列表
巴比特 | 元宇宙每日必读:要求高级政府官员披露其在NFT上的所有投资?美国政府道德办公室发布的这份法律咨询还说了什么?...
FANUC机器人用户自定义报警的具体配置方法详解
[low code] 1387 try to understand the essence of low code platform design from another angle
ORM初识和数据库操作
C语言学生成绩管理系统
框架介绍
专访SPORTFIVE李莹:如何用Web3的方式推动体育IP拓展“新商业版图”
Admin组件
16.target和currenTarget的区别?