Amazon EMR上的Hbase通过Thrift连接超时

raj*_*jat 8 hbase thrift amazon-emr

我使用TThreadPoolServerThrift服务器写HBase ,我有最大工作线程的以下HBase设置:

HBase的-site.xml中

<property>
   <name>hbase.thrift.maxWorkerThreads</name>
   <value>50000</value>
   <source>hbase-site.xml</source>
</property>
Run Code Online (Sandbox Code Playgroud)

这是我用来执行并发写入的脚本:

test.py

import happybase
from random import randint

connection = happybase.Connection('ec2-xx-xx-xx-xx.compute-1.amazonaws.com', timeout=50000)
table_name = 'test' + str(randint(0,1000000))

families = {
    'cf1': dict(max_versions=1),
}
connection.create_table(table_name, families)
table = connection.table(name=table_name)
x = 0
while x < 1000000:
    table.put('row-key' + str(x), {b'cf1:qual1': b'testtesttest', b'cf1:qual2': b'testestest'})
    x += 1
Run Code Online (Sandbox Code Playgroud)

现在如果我同时运行25个test.py实例,在创建18-20个连接之后,由于超时错误,所有其他连接都无法连接,我检查了hbase服务器,thrift只能创建300个线程,当该限制是到达新的连接不被接受并且超时.

即使有300个线程,系统也没有压力,CPU和内存消耗非常低,因此我认为这是因为某些配置.

有人可以指导我为什么thrift没有创建更多的线程,在我的HBase配置中,thrift最大线程数是多少?