Skip to content

Commit

Permalink
HBASE-14433 Set down the client executor core thread count from 256 t…
Browse files Browse the repository at this point in the history
…o number of processors
  • Loading branch information
saintstack committed Sep 16, 2015
1 parent 27a993d commit d2e3381
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ private ExecutorService getBatchPool() {
synchronized (this) {
if (batchPool == null) {
this.batchPool = getThreadPool(conf.getInt("hbase.hconnection.threads.max", 256),
conf.getInt("hbase.hconnection.threads.core", 256), "-shared-", null);
conf.getInt("hbase.hconnection.threads.core",
Runtime.getRuntime().availableProcessors()),
"-shared-", null);
this.cleanupPool = true;
}
}
Expand All @@ -385,7 +387,7 @@ private ExecutorService getThreadPool(int maxThreads, int coreThreads, String na
maxThreads = Runtime.getRuntime().availableProcessors() * 8;
}
if (coreThreads == 0) {
coreThreads = Runtime.getRuntime().availableProcessors() * 8;
coreThreads = Runtime.getRuntime().availableProcessors();
}
long keepAliveTime = conf.getLong("hbase.hconnection.threads.keepalivetime", 60);
BlockingQueue<Runnable> workQueue = passedWorkQueue;
Expand Down
8 changes: 8 additions & 0 deletions hbase-client/src/test/resources/hbase-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@
<name>hbase.defaults.for.version.skip</name>
<value>true</value>
</property>
<property>
<name>hbase.hconnection.meta.lookup.threads.core</name>
<value>4</value>
</property>
<property>
<name>hbase.hconnection.threads.keepalivetime</name>
<value>3</value>
</property>
</configuration>
8 changes: 8 additions & 0 deletions hbase-server/src/test/resources/hbase-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,12 @@
Enable replay sanity checks on procedure tests.
</description>
</property>
<property>
<name>hbase.hconnection.meta.lookup.threads.core</name>
<value>4</value>
</property>
<property>
<name>hbase.hconnection.threads.keepalivetime</name>
<value>3</value>
</property>
</configuration>

0 comments on commit d2e3381

Please sign in to comment.