3

需要哪些设置来确保队列代理在 60 秒内不超时?我的 http 请求在 60 秒内超时,并且 queue-proxy 有这些错误消息

{"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 375\nTCP: inuse 5 orphan 1 tw 95 alloc 54 mem 7\nUDP: inuse 0 mem 3\nUDPLITE: inuse 0\nRAW: inuse 0\nFRAG: inuse 0 memory 0\n","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.func1\n\t/home/prow/go/src/knative.dev/serving/pkg/network/error_handler.go:31\nnet/http/httputil.(*ReverseProxy).ServeHTTP\n\t/usr/local/go/src/net/http/httputil/reverseproxy.go:251\nknative.dev/serving/pkg/queue.(*requestMetricHandler).ServeHTTP\n\t/home/prow/go/src/knative.dev/serving/pkg/queue/request_metric.go:71\nmain.handler.func1\n\t/home/prow/go/src/knative.dev/serving/cmd/queue/main.go:197\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\nknative.dev/serving/pkg/queue.ForwardedShimHandler.func1\n\t/home/prow/go/src/knative.dev/serving/pkg/queue/forwarded_shim.go:100\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\nknative.dev/serving/pkg/queue.(*timeoutHandler).ServeHTTP.func1\n\t/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 秒时,队列中的其他请求将超时。

4

1 回答 1

0

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

"error":"context canceled"

通常是赠品。

于 2020-05-19T22:02:05.847 回答