Knative服务http超时设置



需要什么设置才能确保队列代理在60秒内不会超时?我的http请求在60秒内超时,队列代理有以下错误消息

{"level":"error","ts":"2020-02-27T11:44:58.886Z","logger":"queueproxy","caller":"network/error_handler.go:31","msg":"error reverse proxying request; sockstat: sockets: used 375nTCP: inuse 5 orphan 1 tw 95 alloc 54 mem 7nUDP: inuse 0 mem 3nUDPLITE: inuse 0nRAW: inuse 0nFRAG: inuse 0 memory 0n","commit":"96cffff","knative.dev/key":"playground-flows-master/sleeper-service-pclb2","knative.dev/pod":"sleeper-service-pclb2-deployment-6bc5479789-gzmcj","error":"context canceled","stacktrace":"knative.dev/serving/pkg/network.ErrorHandler.func1nt/home/prow/go/src/knative.dev/serving/pkg/network/error_handler.go:31nnet/http/httputil.(*ReverseProxy).ServeHTTPnt/usr/local/go/src/net/http/httputil/reverseproxy.go:251nknative.dev/serving/pkg/queue.(*requestMetricHandler).ServeHTTPnt/home/prow/go/src/knative.dev/serving/pkg/queue/request_metric.go:71nmain.handler.func1nt/home/prow/go/src/knative.dev/serving/cmd/queue/main.go:197nnet/http.HandlerFunc.ServeHTTPnt/usr/local/go/src/net/http/server.go:2007nknative.dev/serving/pkg/queue.ForwardedShimHandler.func1nt/home/prow/go/src/knative.dev/serving/pkg/queue/forwarded_shim.go:100nnet/http.HandlerFunc.ServeHTTPnt/usr/local/go/src/net/http/server.go:2007nknative.dev/serving/pkg/queue.(*timeoutHandler).ServeHTTP.func1nt/home/prow/go/src/knative.dev/serving/pkg/queue/timeout.go:80"}

版本和设置如下。

Knative版本v0.11.0

Istio版本:1.3.5

KnativeService:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: sleeper-service
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/maxScale: "1"
spec:
containerConcurrency: 0
containers:
- env:
- name: MILLISECONDS
value: "330000"
image: <image>
name: user-container
ports:
- containerPort: 8000
name: http1
protocol: TCP
readinessProbe:
successThreshold: 1
tcpSocket:
port: 0
resources: {}
timeoutSeconds: 500
traffic:
- latestRevision: true
percent: 100

当maxScaling设置为1时,如果每个请求花费的时间超过60秒,则队列中的其他请求将超时。

这很可能是客户端超时。查看您的服务,如果根本没有发送响应数据,它将在500秒后内部超时。

"error":"context canceled"

通常是赠品。

相关内容

  • 没有找到相关文章

最新更新