Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于消费端线程模型 #6650

Closed
shihuaguo opened this issue Aug 27, 2020 · 3 comments
Closed

关于消费端线程模型 #6650

shihuaguo opened this issue Aug 27, 2020 · 3 comments

Comments

@shihuaguo
Copy link

我看了不少关于dubbo2.7.5版本对于消费端线程模型优化的帖子,也参考了#4106#4103,了解到现在的消费端由业务线程自己负责监测并解析返回结果,免去了额外的消费端线程池开销。不过实践和观察源码发现,这仅仅只是在同步(Sync)调用时是这样,如果是异步调用,还是会将返回结果丢到一个共享连接池去处理的。这是为何呢?
考虑一个基于spring webflux的项目,作为dubbo consumer(见下图)处理一个请求的过程:

1、Reactor-http-nio 线程收到请求;
2、因为wefflux不能阻塞当前线程,所以通过异步去调用dubbo服务,此时通过Netty worker thread去发送数据;
3、数据返回后,由于是Async call,所以会将结果放到sharedExecutor去执行;
疑问:
1、发送端的NettyClient是否可以自定义线程池,或者使用上述第一步相同的线程,以减少线程切换的开销?(就像图中webClient进行http请求会和webflux server共用相同的线程池)
2、数据返回后,能否和Sync调用一样,也使用ThreadlessExecutor去处理,这样仍然会继续使用上述第一步的线程,以减少线程切换的开销?

1598511744

@shildondu
Copy link

你好,我也有这个疑惑,close这个issue是已经明白了吗,麻烦可以解答一下吗

2 similar comments
@1095071913
Copy link

你好,我也有这个疑惑,close这个issue是已经明白了吗,麻烦可以解答一下吗

@zhanghailang123
Copy link

你好,我也有这个疑惑,close这个issue是已经明白了吗,麻烦可以解答一下吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants