[alibaba/tengine]dubbo 连接瞬间超时

2024-05-15 164 views
3

日志如下

2023/12/08 08:10:07 [warn] 45#45: 57631 multi: multi connection detach not empty 00007F45BD856FA0 2023/12/08 08:10:07 [error] 45#45: 57627 upstream timed out (110: Operation timed out) while connecting to upstream, client: 39.99.246.117, server: _, subrequest: "/app/Service/getxxxx", upstream: "dubbo://39.101.204.9:20918" 39.99.246.117 - - [08/Dec/2023:08:10:07 +0000] 39.99.253.87:30004 "POST /app/Service/getxxxx HTTP/1.1" 504 164 0.026 "-" "PostmanRuntime/7.35.0" 39.101.204.9:20918 504 0.026 "http://39.99.253.87:30004/app/Service/getxxxx"

回答

2

怀疑是接口返回数据太多了 不知道是不是配置问题

0

返回结果大约22k 左右 dubbo_buffer_size 设置不起作用

8
  1. 打开debug日志 看下详细的错误信息

upstream timed out (110: Operation timed out) while connecting to upstream 这是dubbo建链对端连接超时

  1. 39.101.204.9:20918端口是正常的?

  2. dubbo_connect_timeout 指令设置的是多大

  3. 抓包看下建链报文

9
  1. 打开debug日志 看下详细的错误信息

upstream timed out (110: Operation timed out) while connecting to upstream 这是dubbo建链对端连接超时

  1. 39.101.204.9:20918端口是正常的?
  2. dubbo_connect_timeout 指令设置的是多大
  3. 抓包看下建链报文

网关机器抓包dubbo 正常返回数据了

1

image

8

@lianglli

8

我需要如何设置超时时间 才能起作用呢

4

尝试使用小的较小报文时。即使阻塞10s 依旧能成功。在返回较大报文时直接504

5
  if (c == item->connection) {
        //found
        multi_c = ngx_get_multi_connection(c);
        if (!ngx_queue_empty(&multi_c->data)) {
            ngx_log_error(NGX_LOG_WARN, c->log,
                          0, "multi: multi connection detach not empty %p", c);
        }

        ngx_log_error(NGX_LOG_INFO, c->log,
                      0, "multi: multi connection detach %p", c);

        ngx_queue_remove(&item->queue);

        return NGX_OK;
    }

错误是从这里出来的

5

@lianglli

5

023-12-12 10:58:07 2023/12/12 02:58:07 [info] 48#48: 1302 multi: get new connection, c: 00007F78C4FE1FF0, code -2 2023-12-12 10:58:07 2023/12/12 02:58:07 [info] 48#48: 1302 multi: connect new to backend 00007F78C4FE1FF0 2023-12-12 10:58:07 2023/12/12 02:58:07 [info] 48#48: 1302 dubbo: pc 00007F78C4FE1FF0 create dubbo connection 00007F78C4D5D3D0 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 dubbo: response parse again 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 dubbo: response parse again 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 dubbo: response parse again 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 dubbo: response parse again 2023-12-12 10:58:09 2023/12/12 02:58:09 [warn] 48#48: 1302 multi: multi connection detach not empty 00007F78C4FE1FF0 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 multi: multi connection detach 00007F78C4FE1FF0 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1301 multi: free request c: 00007F78C4FE1FF0, r: 00007F78C4D78A70 end while connecting to upstream, client: 172.20.0.1, server: , subrequest: "/dubbo/nacos", upstream: "dubbo://172.20.0.4:20880" 2023-12-12 10:58:09 2023/12/12 02:58:09 [info] 48#48: 1302 multi: free http request 00007F78C4D78A70, 00007F78C4FE1FF0 2023-12-12 10:58:09 2023/12/12 02:58:09 [error] 48#48: 1301 upstream timed out (110: Operation timed out) while connecting to upstream, client: 172.20.0.1, server: , subrequest: "/dubbo/nacos", upstream: "dubbo://172.20.0.4:20880"

6

经过测试发现是apisix 集成问题