You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/29 20:23:13 UTC

[GitHub] sijie commented on a change in pull request #1308: longPollThreadPool can not be null

sijie commented on a change in pull request #1308:  longPollThreadPool can not be null
URL: https://github.com/apache/bookkeeper/pull/1308#discussion_r178171278
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
 ##########
 @@ -1288,10 +1288,15 @@ public ServerConfiguration setNumLongPollWorkerThreads(int numThreads) {
 
     /**
      * Get the number of threads that should handle long poll requests.
-     * @return
+     *
+     * <p>If the number of threads is zero or negative, bookie will fallback to
+     * use read threads. If there is no read threads used, it will create a thread pool
+     * with {@link Runtime#availableProcessors()} threads.
+     *
+     * @return the number of threads that should handle long poll requests, default value is 0.
      */
     public int getNumLongPollWorkerThreads() {
-        return getInt(NUM_LONG_POLL_WORKER_THREADS, 10);
+        return getInt(NUM_LONG_POLL_WORKER_THREADS, 0);
 
 Review comment:
   @yzang 
   
   good point.
   
   this change attempts to allow not creating those threads or fallback to use read thread pool for most of the use cases - either they don't use long poll features (e.g. pulsar), or the requirement for separating long poll reads and catch up reads is not that strong.
   
   for a better I/O isolation, write/read/longpoll reads should usually be isolated into different I/O thread pools. at twitter, I think all of our configurations have set this value to 2~3 times of number of available processor. so this change won't affect there.

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