[ 
https://issues.apache.org/jira/browse/HDFS-17254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17796514#comment-17796514
 ] 

ASF GitHub Bot commented on HDFS-17254:
---------------------------------------

tomscut commented on code in PR #6307:
URL: https://github.com/apache/hadoop/pull/6307#discussion_r1426092305


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java:
##########
@@ -144,7 +146,9 @@ public DatanodeHttpServer(final Configuration conf,
     confForCreate.set(FsPermission.UMASK_LABEL, "000");
 
     this.bossGroup = new NioEventLoopGroup();
-    this.workerGroup = new NioEventLoopGroup();
+    int workerThreads = conf.getInt(DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY,
+        DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT);
+    this.workerGroup = new NioEventLoopGroup(workerThreads);

Review Comment:
   Better to use a cached thread pool here. `this.workerGroup = new 
NioEventLoopGroup(workerCount, Executors.newCachedThreadPool())`. 





> DataNode httpServer has too many worker threads
> -----------------------------------------------
>
>                 Key: HDFS-17254
>                 URL: https://issues.apache.org/jira/browse/HDFS-17254
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>            Reporter: Liangjun He
>            Assignee: Liangjun He
>            Priority: Minor
>              Labels: pull-request-available
>
> When optimizing the thread number of high-density storage DN, we found the 
> number of worker threads for the DataNode httpServer is twice the number of 
> available cores on node , resulting in too many threads. We can change this 
> to be configurable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to