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/03/05 09:17:59 UTC

[GitHub] [servicecomb-java-chassis] yhs0092 opened a new issue #2277: Java-Chassis的consumer端可能混用HTTP/1.1和HTTP/2的连接向provider端发送请求吗?

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


   在Java-Chassis关于[REST客户端连接池的说明](https://docs.servicecomb.io/java-chassis/zh_CN/config-reference/rest-transport-client/)中,有如下描述
   > 连接池在计算是否超过大小的时候,会同时检查这两个配置项。假设访问的服务器为H,那么上述配置,和H建立的最大连接可能性为 HTTP:HTTP2=50:0, HTTP:HTTP2=0:5, HTTP:HTTP2=20:3等。一个客户端和H建立的总的连接数还和servicecomb.rest.client.verticle-count 有关。可以理解为每个vertical会针对H创建一个连接池,连接池个数为vertical-count。
   
   言下之意似乎是Java-Chassis的客户端可能会对某个provider的endpoint混合建立HTTP/1.1和HTTP/2的连接。
   但是观察Java-Chassis的源码,无论是master分支的`org.apache.servicecomb.transport.rest.client.RestTransportClient#findHttpClientPool`还是1.3分支的`org.apache.servicecomb.transport.rest.client.RestTransportClient#send`,对于HTTP/1.1和HTTP/2都是用两个客户端实例分别处理的。
   
   那么,实际上在Java-Chassis里,可能出现对同一个endpoint,连接数呈`HTTP:HTTP2=20:3`分布的情况吗?


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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2277: Java-Chassis的consumer端可能混用HTTP/1.1和HTTP/2的连接向provider端发送请求吗?

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2277:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2277#issuecomment-791297005


   这个描述的是HTTP/2连接池的场景。即HTTP/2连接池可能同时管理HTTP/1连接和HTTP/2连接。 HTTP/2协议首先是通过HTTP/1接入的,然后会执行Upgrade升级为HTTP/2,中间会有HTTP/1连接。 


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



[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #2277: Java-Chassis的consumer端可能混用HTTP/1.1和HTTP/2的连接向provider端发送请求吗?

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


   此外,Vert.x的客户端在`HttpClientOptions#protocolVersion`属性中限制了客户端请求的协议版本,不像是能用同一个HttpClient实例同时建立HTTP/1.1和HTTP/2连接的样子。
   但是Vert.x在`HttpChannelConnector`构造方法中还要计算HTTP/1.1连接和HTTP/2连接的权重(见 [HttpChannelConnector构造方法](https://github.com/eclipse-vertx/vert.x/blob/5a07e455fce94b7d458fb629a14167acda119391/src/main/java/io/vertx/core/http/impl/HttpChannelConnector.java#L70)),看着像是会同时容纳HTTP/1.1和HTTP/2连接?这个地方也有点让人看不懂


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



[GitHub] [servicecomb-java-chassis] yhs0092 edited a comment on issue #2277: Java-Chassis的consumer端可能混用HTTP/1.1和HTTP/2的连接向provider端发送请求吗?

Posted by GitBox <gi...@apache.org>.
yhs0092 edited a comment on issue #2277:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2277#issuecomment-791288421


   此外,Vert.x的客户端在`HttpClientOptions#protocolVersion`属性中限制了客户端请求的协议版本,不像是能用同一个HttpClient实例同时建立HTTP/1.1和HTTP/2连接的样子。
   但是Vert.x在`HttpChannelConnector`构造方法中还要计算HTTP/1.1连接和HTTP/2连接的权重(见 [HttpChannelConnector构造方法](https://github.com/eclipse-vertx/vert.x/blob/5a07e455fce94b7d458fb629a14167acda119391/src/main/java/io/vertx/core/http/impl/HttpChannelConnector.java#L70)),看着像是会同时容纳HTTP/1.1和HTTP/2连接?
   这个地方也有点让人看不懂,像是矛盾的


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2277: Java-Chassis的consumer端可能混用HTTP/1.1和HTTP/2的连接向provider端发送请求吗?

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


   这个描述的是HTTP/2连接池的场景。即HTTP/2连接池可能同时管理HTTP/1连接和HTTP/2连接。 


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