You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/02/25 03:23:56 UTC

[GitHub] [servicecomb-java-chassis] jiangqiushi commented on issue #1593: 客户端偶现超时,SlowInvocationLogger无法提供有用信息

jiangqiushi commented on issue #1593: 客户端偶现超时,SlowInvocationLogger无法提供有用信息
URL: https://github.com/apache/servicecomb-java-chassis/issues/1593#issuecomment-590663607
 
 
   > 从日志看,可能是客户端参数设置不合理,导致并发度过低,大量请求排队超时的缘故。 这些信息反映了这个情况:
   > 
   > 1. 总时间超过5s,但是每个阶段时间都很少。 但是后面部分的时间为0, 所以其实是没有计算到后面的时间就超时了。在send request之前,就只有排队了。 这个和现象服务端没收到请求是一致的。
   > 
   > ```
   >   total      : 5001.842 ms
   >     prepare                : 0.3 ms
   >     handlers request       : 0.147 ms
   >     client filters request : 0.30 ms
   >     send request           : 0.0 ms
   >     get connection         : 0.0 ms
   >     write to buf           : 0.0 ms
   >     wait response          : 0.0 ms
   >     wake consumer          : 0.1 ms
   >     client filters response: 0.0 ms
   >     handlers response      : 1.17 ms
   > ```
   > 
   > 1. 从下面日志看出大量请求排队, 从连接数为2可以看出,部分参数设置是不合理的,连接数过少,并发度上不去。
   > 
   > ```
   >     client.endpoints:
   >       remote                connectCount disconnectCount queue         connections send(Bps) receive(Bps)
   >       10.31.57.5:28087      2            3               165           2           9         5.223K
   >       10.31.35.137:28087    3            3               0  
   > ```
   > 
   > 导致这个原因可能是 vertical 数量设置过小的缘故, [参考](https://docs.servicecomb.io/java-chassis/zh_CN/transports/verticle-count/)
   > 
   > 1.2.0.Bxxx版本实际上是 1.2.0的 pre release版本,所以估计是老版本问题,建议升级下新版本再试试。 或者加上下面的配置项试试:
   > 
   > 估计是老版本:
   > 
   > ```
   > servicecomb.rest.server.thread-count=10
   > ```
   > 
   > 或者新版本:
   > 
   > ```
   > servicecomb.rest.server.verticle-count=10
   > ```
   
   实际上我们期望走http2调用,服务端启用了http2,ServiceComb用户手册中关于[HTTP2](https://docs.servicecomb.io/java-chassis/1.x/zh_CN/transports/http2.html)的介绍,
   连接数应该是足够的。
   服务端配置:
   ```xml
     rest:
       address: 10.31.57.5:28087?sslEnabled=false&protocol=http2
       server:
         thread-count: 32
         connection:
           idleTimeoutInSeconds: 60
     executor:
       default:
         group: 2
         thread-per-group: 32
   ```
   客户端的配置:
   ```xml
     rest:
       client:
         thread-count: 32
         connection:
           maxPoolSize: 10
           idleTimeoutInSeconds: 10
           keepAlive: true
         http2:
           maxPoolSize: 1
           idleTimeoutInSeconds: 0
   ```
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services