Index: hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java (revision 1505292) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java (working copy) @@ -99,7 +99,8 @@ } ThriftHBaseServiceHandler(Configuration conf) { - htablePool = new HTablePool(conf, Integer.MAX_VALUE); + int maxPoolSize = conf.getInt("hbase.thrift.htablepool.size.max", 1000); + htablePool = new HTablePool(conf, maxPoolSize); } private HTableInterface getTable(ByteBuffer tableName) { Index: hbase-common/src/main/resources/hbase-default.xml =================================================================== --- hbase-common/src/main/resources/hbase-default.xml (revision 1505292) +++ hbase-common/src/main/resources/hbase-default.xml (working copy) @@ -872,6 +872,15 @@ hbase.thrift.maxQueuedRequests threads. + hbase.thrift.htablepool.size.max + 1000 + The upper bound for the table pool used in the Thrift gateways server. + Since this is per table name, we assume a single table and so with 1000 default + worker threads max this is set to a matching number. For other workloads this number + can be adjusted as needed. + + + hbase.offheapcache.percentage 0 The amount of off heap space to be allocated towards the experimental