You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/08/24 05:10:39 UTC

[GitHub] EdwardLee03 opened a new issue #43: The default size of the services' Thread Pool(Fixed) is 200

EdwardLee03 opened a new issue #43: The default size of the services' Thread Pool(Fixed) is 200
URL: https://github.com/apache/incubator-dubbo-docs/issues/43
 
 
   The default size of the services' Thread Pool(Fixed) is `100` in user doc, but the source code of `FixedThreadPool` is `200`. There are inconsistent.
   
   #### 1. desc of user doc
   `dubbo-protocol.md`,`dubbo-provider.md`
   ```
   | 属性 | 对应URL参数 | 类型 | 是否必填 | 缺省值 | 作用 | 描述 | 兼容性 |
   | threads | threads | int | 可选 | 100 | 性能调优 | 服务线程池大小(固定大小) | 2.0.5以上版本 |
   
   | Attribute     | Corresponding URL parameter | Type           | Required    | Default Value                            | Function                  | Description                              | Compatibility |
   | threads       | threads                     | int            | False       | 100                                      | Performance optimize      | The size of the services' Thread Pool(Fixed) | Above 2.0.5   |
   ```
   
   #### 2. source code of FixedThreadPool
   org.apache.dubbo.common.Constants
   ```java
       public static final String DEFAULT_THREAD_NAME = "Dubbo";
   
       public static final int DEFAULT_CORE_THREADS = 0;
   
       public static final int DEFAULT_THREADS = 200;
   ```
   
   org.apache.dubbo.common.threadpool.support.fixed.FixedThreadPool
   ```java
   public class FixedThreadPool implements ThreadPool {
   
       @Override
       public Executor getExecutor(URL url) {
           String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
           int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
           int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
           return new ThreadPoolExecutor(threads, threads, 0, TimeUnit.MILLISECONDS,
                   queues == 0 ? new SynchronousQueue<Runnable>() :
                           (queues < 0 ? new LinkedBlockingQueue<Runnable>()
                                   : new LinkedBlockingQueue<Runnable>(queues)),
                   new NamedInternalThreadFactory(name, true), new AbortPolicyWithReport(name, url));
       }
   
   }
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org