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 2021/08/13 07:09:24 UTC

[GitHub] [servicecomb-java-chassis] libai245 opened a new issue #2502: 服务使用http2.0后进行压测,接口性能下降

libai245 opened a new issue #2502:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2502


   我们对后端服务进行了http2.0改造,但是性能出下降情况,而且下降的很大,使用http1.0时TPS为1.8W,使用http2.0时TPS仅为6K
   查看性能日志cse_metrics.log后发现在过滤阶段性能差别很大
   ![image](https://user-images.githubusercontent.com/13653371/129316565-c474cdcc-5bbd-4b4a-b539-65d536f54df1.png)
   
   查看线程信息后发现很多线程进入了阻塞状态
   ![image](https://user-images.githubusercontent.com/13653371/129317116-546c3de1-f089-43c8-8ebe-51396c5afc40.png)
   
   ![image](https://user-images.githubusercontent.com/13653371/129317134-d83e5522-9787-4b89-950c-f963d916da24.png)
   
   查看截图中方法发现Http2ServerRequestImpl中很多方法都对同一个connection加了锁
   ![image](https://user-images.githubusercontent.com/13653371/129317303-d952cbdc-7436-4699-bea0-2e9fd2cccb95.png)
   ![image](https://user-images.githubusercontent.com/13653371/129317326-5f3df1c8-d307-4452-8665-7e9fbdff61f9.png)
   
   而HttpServerRequestImpl中没有加锁
   ![image](https://user-images.githubusercontent.com/13653371/129317402-829aedf6-a3f5-48ab-b4e3-0667484546d3.png)
   ![image](https://user-images.githubusercontent.com/13653371/129317418-645bcbd8-1bfb-459d-a740-1a3efe937bb0.png)
   问题应该是在过滤阶段,很多过滤器调用了锁方法,导致锁竞争激烈,所以HTTP2.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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2502: 服务使用http2.0后进行压测,接口性能下降

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2502:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2502#issuecomment-900882953


   这个问题给HTTP2性能优化提供了一个方向。 即不能单纯的通过设置单个连接的并发数来提升处理性能(有锁)。 使用HTTP2也要合理的规划连接个数和每个连接的并发数(servicecomb.rest.server.http2.concurrentStreams)。


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2502: 服务使用http2.0后进行压测,接口性能下降

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2502:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2502#issuecomment-900882953


   这个问题给HTTP2性能优化提供了一个方向。 即不能单纯的通过设置单个连接的并发数来提升处理性能(有锁)。 使用HTTP2也要合理的规划连接个数和每个连接的并发数(servicecomb.rest.server.http2.concurrentStreams)。


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org