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/31 02:32:00 UTC

[GitHub] [servicecomb-java-chassis] qubo11 opened a new issue #2535: Client调用Server的问题咨询

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


   写了一个小例子,就是简单的Client调用Server的demo:
   ![image](https://user-images.githubusercontent.com/4074496/131431604-5caae9a0-3826-4805-8928-997691e0dd16.png)
   
   在Controller中,使用的是业务线程:
   ![image](https://user-images.githubusercontent.com/4074496/131431763-6e261b2a-65e8-4e16-8416-f8e22156431c.png)
   
   当Client调用Server的接口的时候,在RestClientInvocation#invoke方法中,发送请求的时候,会使用EventLoop线程,我看源码有一行注释“从业务线程转移到网络线程中去发送”,疑问:
   1.Client接收请求和Client发送Server请求是同一个EventLoop线程吧?
   2.如果是同一个EventLoop线程,那如果我Client调用Server有阻塞,也会影响Client本身的接收请求的吞吐量吧?
   


-- 
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] qubo11 commented on issue #2535: Client调用Server的问题咨询

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


   我看Client接收到的请求是EventLoop线程8,Client调用Server的EventLoop线程是12。
   
   我的意思是,如果Client调用Server的时候,如果网络或者什么原因,导致时延大,那应该也会影响Client本身接收的请求吧?


-- 
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] qubo11 commented on issue #2535: Client调用Server的问题咨询

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


   我看Client接收到的请求是EventLoop线程8,Client调用Server的EventLoop线程是12。
   
   我的意思是,如果Client调用Server的时候,如果网络或者什么原因,导致时延大,那应该也会影响Client本身接收的请求吧?


-- 
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] qubo11 commented on issue #2535: Client调用Server的问题咨询

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


   上述说的client verticle指定是:ClientVerticle类?server verticle指的是:RestServerVerticle类?
   
   我看他们都是用的同一个vertx实例。没太看出来Client和Server的连接池有什么区别哈,我看都是transport-vert.x-eventloop-thread-x线程。


-- 
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 #2535: Client调用Server的问题咨询

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


   如果你使用的HTTP协议, 请求和应答都是一个连接。 完成请求应答后, 这个连接才会被其他请求复用。 
   event-loop不能阻塞。 


-- 
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 #2535: Client调用Server的问题咨询

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


   如果你使用的HTTP协议, 请求和应答都是一个连接。 完成请求应答后, 这个连接才会被其他请求复用。 
   event-loop不能阻塞。 


-- 
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] fanjiang-2021 commented on issue #2535: Client调用Server的问题咨询

Posted by GitBox <gi...@apache.org>.
fanjiang-2021 commented on issue #2535:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2535#issuecomment-911086504


   #2484


-- 
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 #2535: Client调用Server的问题咨询

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


   连接池和线程池是两个不同的概念。 transport-vert.x-eventloop-thread是线程池。 


-- 
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] fanjiang-2021 edited a comment on issue #2535: Client调用Server的问题咨询

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


   #2484 可以参考一下这个
   如果使用reactive模式,因为业务逻辑直接在网络线程中执行,也就是server verticle中执行
   此时,如果需要向外发送请求,并不会再切到client verticle去(可能涉及线程切换),而是直接在当前verticle创建连接池,你们这种应该是没有使用reactive模式吧,这样应该会切到client verticle去创建连接池
   


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