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

why does dubbo creates a new ThreadPool for each connection? #4467

Closed
CodingSinger opened this issue Jul 4, 2019 · 5 comments
Closed

why does dubbo creates a new ThreadPool for each connection? #4467

CodingSinger opened this issue Jul 4, 2019 · 5 comments
Milestone

Comments

@CodingSinger
Copy link
Member

   public WrappedChannelHandler(ChannelHandler handler, URL url) {
        this.handler = handler;
        this.url = url;
       // would create a new ThreadPoolExecutor
        executor = (ThreadPoolExecutor) ExtensionLoader.getExtensionLoader(ThreadPool.class).getAdaptiveExtension().getExecutor(url);

    }
@chickenlj chickenlj added this to the 2.7.4 milestone Jul 8, 2019
@cvictory
Copy link
Contributor

cvictory commented Jul 9, 2019

那么每个连接几个线程比较合适呢? 我觉得一般来说肯定是一个大的线程池,除非特别重要的方法或者特别慢的方法才需要隔离吧。

@CodingSinger
Copy link
Member Author

@cvictory 是的呀,应该统一一个大线程池就够了呀,为啥这里要隔离呢

@chickenlj
Copy link
Contributor

  • Provider端
    默认共用同一个线程池,在有些情况下也会根据protocol划分多个线程池,如:

      <dubbo:protocol id="1" name="dubbo" port="20880"/>
      <dubbo:protocol id="2" name="dubbo" port="20881"/>

    则protocol 1 和 protocol 2各自使用自己的线程池

  • Consumer端
    当前是每个链接共享一个线程池,如有consumer到3个provider分别有一个长链接,则每个长链接各自使用独立的线程池。

@chickenlj
Copy link
Contributor

参见这个 #2013

@chickenlj
Copy link
Contributor

对于consumer线程池,当前正在尝试优化中:
#4131

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

3 participants