Repository: spark
Updated Branches:
  refs/heads/master 1a2862535 -> 6353425af


[SPARK-25641] Change the spark.shuffle.server.chunkFetchHandlerThreadsPercent 
default to 100

## What changes were proposed in this pull request?

We want to change the default percentage to 100 for 
spark.shuffle.server.chunkFetchHandlerThreadsPercent. The reason being
currently this is set to 0. Which means currently if server.ioThreads > 0, the 
default number of threads would be 2 * #cores instead of server.io.Threads. We 
want the default to server.io.Threads in case this is not set at all. Also here 
a default of 0 would also mean 2 * #cores

## How was this patch tested?
Manual
(Please explain how this patch was tested. E.g. unit tests, integration tests, 
manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, 
remove this)

Please review http://spark.apache.org/contributing.html before opening a pull 
request.

Closes #22628 from redsanket/SPARK-25641.

Lead-authored-by: Sanket Chintapalli <schin...@yahoo-inc.com>
Co-authored-by: Sanket Chintapalli <chintapalli.sanketre...@gmail.com>
Signed-off-by: Thomas Graves <tgra...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6353425a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6353425a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6353425a

Branch: refs/heads/master
Commit: 6353425af76f9cc9de7ee4094f41df7a7390d898
Parents: 1a28625
Author: Sanket Chintapalli <schin...@yahoo-inc.com>
Authored: Mon Oct 8 13:19:34 2018 -0500
Committer: Thomas Graves <tgra...@apache.org>
Committed: Mon Oct 8 13:19:34 2018 -0500

----------------------------------------------------------------------
 .../apache/spark/network/util/TransportConf.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6353425a/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java
----------------------------------------------------------------------
diff --git 
a/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java
 
b/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java
index 6d5cccd..43a6bc7 100644
--- 
a/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java
+++ 
b/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java
@@ -296,17 +296,21 @@ public class TransportConf {
    * and could take long time to process due to disk contentions. By 
configuring a slightly
    * higher number of shuffler server threads, we are able to reserve some 
threads for
    * handling other RPC messages, thus making the Client less likely to 
experience timeout
-   * when sending RPC messages to the shuffle server. Default to 0, which is 
2*#cores
-   * or io.serverThreads. 90 would mean 90% of 2*#cores or 90% of 
io.serverThreads
-   * which equals 0.9 * 2*#cores or 0.9 * io.serverThreads.
+   * when sending RPC messages to the shuffle server. The number of threads 
used for handling
+   * chunked fetch requests are percentage of io.serverThreads (if defined) 
else it is a percentage
+   * of 2 * #cores. However, a percentage of 0 means netty default number of 
threads which
+   * is 2 * #cores ignoring io.serverThreads. The percentage here is 
configured via
+   * spark.shuffle.server.chunkFetchHandlerThreadsPercent. The returned value 
is rounded off to
+   * ceiling of the nearest integer.
    */
   public int chunkFetchHandlerThreads() {
     if (!this.getModuleName().equalsIgnoreCase("shuffle")) {
       return 0;
     }
     int chunkFetchHandlerThreadsPercent =
-      conf.getInt("spark.shuffle.server.chunkFetchHandlerThreadsPercent", 0);
-    return this.serverThreads() > 0 ? (this.serverThreads() * 
chunkFetchHandlerThreadsPercent)/100:
-      (2 * NettyRuntime.availableProcessors() * 
chunkFetchHandlerThreadsPercent)/100;
+      conf.getInt("spark.shuffle.server.chunkFetchHandlerThreadsPercent", 100);
+    return (int)Math.ceil(
+     (this.serverThreads() > 0 ? this.serverThreads() : 2 * 
NettyRuntime.availableProcessors()) *
+     chunkFetchHandlerThreadsPercent/(double)100);
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to