You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@hbase.apache.org by sudo rm -rf /* <le...@qq.com> on 2020/06/03 02:00:07 UTC
HBase资源隔离队列参数貌似不生效
配置了队列隔离参数,参数如下:hbase.regionserver.handler.count 30
hbase.ipc.server.callqueue.handler.factor 1
hbase.ipc.server.callqueue.read.ratio 0.5
hbase.ipc.server.callqueue.scan.ratio 0.1
这样我控制scan的线程为1,
此时,查看线程的分配情况
接着下运行测试代码,只有scan的操作。
from happybase import ConnectionPool
import time
pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
for i in range(200):
start = time.time()
try:
with pool.connection(2000) as con:
table = con.table("table_name")
res = list(table.scan(filter="PrefixFilter('273810955|')",
row_start='\x0f\x10&R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku ^\x92k',
limit=3))
except Exception as e:
pass
end = time.time()
print 'timeout: %d' % (end - start)
此时线程的运行情况
此时我们的CPU占用,已经被跑满了
为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
回复: HBase资源隔离队列参数貌似不生效
Posted by sudo rm -rf /* <le...@qq.com>.
RegionServer的CPU持续上升, 而测试的Client是在另一台机器上的,之间通过thrift server通信
------------------ 原始邮件 ------------------
发件人: "Guanghao Zhang"<zghaobac@gmail.com>;
发送时间: 2020年6月3日(星期三) 中午11:30
收件人: "user-zh"<user-zh@hbase.apache.org>;
主题: Re: HBase资源隔离队列参数貌似不生效
是RegionServer CPU高, 还是Client测CPU高?
sudo rm -rf /* <leo9547@qq.com> 于2020年6月3日周三 上午10:44写道:
> 我用的HBase版本是cdh6.3.2-hbase2.1.0
>
>
>
>
> ------------------&nbsp;原始邮件&nbsp;------------------
> 发件人:&nbsp;"张铎(Duo Zhang)"<palomino219@gmail.com&gt;;
> 发送时间:&nbsp;2020年6月3日(星期三) 上午10:22
> 收件人:&nbsp;"user-zh"<user-zh@hbase.apache.org&gt;;
>
> 主题:&nbsp;Re: HBase资源隔离队列参数貌似不生效
>
>
>
> 图好像看不到?
>
> sudo rm -rf /* <leo9547@qq.com&gt; 于2020年6月3日周三 上午10:00写道:
>
> &gt; 配置了队列隔离参数,参数如下:
> &gt; hbase.regionserver.handler.count 30
> &gt; hbase.ipc.server.callqueue.handler.factor 1
> &gt; hbase.ipc.server.callqueue.read.ratio 0.5
> &gt; hbase.ipc.server.callqueue.scan.ratio 0.1
> &gt;
> &gt; 这样我控制scan的线程为1,
> &gt; 此时,查看线程的分配情况
> &gt;
> &gt;
> &gt; 接着下运行测试代码,只有scan的操作。
> &gt; from happybase import ConnectionPool
> &gt; import time
> &gt;
> &gt; pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
> &gt; for i in range(200):
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; start = time.time()
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; try:
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with
> pool.connection(2000) as con:
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> table = con.table("table_name")
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> res = list(table.scan(filter="PrefixFilter('273810955|')",
> &gt;
> &gt;
> row_start='\x0f\x10&amp;R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku
> &gt; ^\x92k',
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> limit=3))
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; except Exception as e:
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; end = time.time()
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; print 'timeout: %d' % (end - start)
> &gt;
> &gt; 此时线程的运行情况
> &gt;
> &gt; 此时我们的CPU占用,已经被跑满了
> &gt;
> 为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
> &gt;
> &gt;
Re: HBase资源隔离队列参数貌似不生效
Posted by Guanghao Zhang <zg...@gmail.com>.
是RegionServer CPU高, 还是Client测CPU高?
sudo rm -rf /* <le...@qq.com> 于2020年6月3日周三 上午10:44写道:
> 我用的HBase版本是cdh6.3.2-hbase2.1.0
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "张铎(Duo Zhang)"<palomino219@gmail.com>;
> 发送时间: 2020年6月3日(星期三) 上午10:22
> 收件人: "user-zh"<user-zh@hbase.apache.org>;
>
> 主题: Re: HBase资源隔离队列参数貌似不生效
>
>
>
> 图好像看不到?
>
> sudo rm -rf /* <leo9547@qq.com> 于2020年6月3日周三 上午10:00写道:
>
> > 配置了队列隔离参数,参数如下:
> > hbase.regionserver.handler.count 30
> > hbase.ipc.server.callqueue.handler.factor 1
> > hbase.ipc.server.callqueue.read.ratio 0.5
> > hbase.ipc.server.callqueue.scan.ratio 0.1
> >
> > 这样我控制scan的线程为1,
> > 此时,查看线程的分配情况
> >
> >
> > 接着下运行测试代码,只有scan的操作。
> > from happybase import ConnectionPool
> > import time
> >
> > pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
> > for i in range(200):
> > start = time.time()
> > try:
> > with
> pool.connection(2000) as con:
> >
> table = con.table("table_name")
> >
> res = list(table.scan(filter="PrefixFilter('273810955|')",
> >
> >
> row_start='\x0f\x10&R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku
> > ^\x92k',
> >
> limit=3))
> > except Exception as e:
> > pass
> > end = time.time()
> > print 'timeout: %d' % (end - start)
> >
> > 此时线程的运行情况
> >
> > 此时我们的CPU占用,已经被跑满了
> >
> 为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
> >
> >
回复: HBase资源隔离队列参数貌似不生效
Posted by sudo rm -rf /* <le...@qq.com>.
我用的HBase版本是cdh6.3.2-hbase2.1.0
------------------ 原始邮件 ------------------
发件人: "张铎(Duo Zhang)"<palomino219@gmail.com>;
发送时间: 2020年6月3日(星期三) 上午10:22
收件人: "user-zh"<user-zh@hbase.apache.org>;
主题: Re: HBase资源隔离队列参数貌似不生效
图好像看不到?
sudo rm -rf /* <leo9547@qq.com> 于2020年6月3日周三 上午10:00写道:
> 配置了队列隔离参数,参数如下:
> hbase.regionserver.handler.count 30
> hbase.ipc.server.callqueue.handler.factor 1
> hbase.ipc.server.callqueue.read.ratio 0.5
> hbase.ipc.server.callqueue.scan.ratio 0.1
>
> 这样我控制scan的线程为1,
> 此时,查看线程的分配情况
>
>
> 接着下运行测试代码,只有scan的操作。
> from happybase import ConnectionPool
> import time
>
> pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
> for i in range(200):
> start = time.time()
> try:
> with pool.connection(2000) as con:
> table = con.table("table_name")
> res = list(table.scan(filter="PrefixFilter('273810955|')",
>
> row_start='\x0f\x10&R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku
> ^\x92k',
> limit=3))
> except Exception as e:
> pass
> end = time.time()
> print 'timeout: %d' % (end - start)
>
> 此时线程的运行情况
>
> 此时我们的CPU占用,已经被跑满了
> 为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
>
>
回复: HBase资源隔离队列参数貌似不生效
Posted by sudo rm -rf /* <le...@qq.com>.
调完参数后,线程的初始化状态
测试代码运行线程的状态
我们的CPU立马升高了
看看能不能看到图片,感谢张老师
------------------ 原始邮件 ------------------
发件人: "张铎(Duo Zhang)"<palomino219@gmail.com>;
发送时间: 2020年6月3日(星期三) 上午10:22
收件人: "user-zh"<user-zh@hbase.apache.org>;
主题: Re: HBase资源隔离队列参数貌似不生效
图好像看不到?
sudo rm -rf /* <leo9547@qq.com> 于2020年6月3日周三 上午10:00写道:
> 配置了队列隔离参数,参数如下:
> hbase.regionserver.handler.count 30
> hbase.ipc.server.callqueue.handler.factor 1
> hbase.ipc.server.callqueue.read.ratio 0.5
> hbase.ipc.server.callqueue.scan.ratio 0.1
>
> 这样我控制scan的线程为1,
> 此时,查看线程的分配情况
>
>
> 接着下运行测试代码,只有scan的操作。
> from happybase import ConnectionPool
> import time
>
> pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
> for i in range(200):
> start = time.time()
> try:
> with pool.connection(2000) as con:
> table = con.table("table_name")
> res = list(table.scan(filter="PrefixFilter('273810955|')",
>
> row_start='\x0f\x10&R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku
> ^\x92k',
> limit=3))
> except Exception as e:
> pass
> end = time.time()
> print 'timeout: %d' % (end - start)
>
> 此时线程的运行情况
>
> 此时我们的CPU占用,已经被跑满了
> 为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
>
>
Re: HBase资源隔离队列参数貌似不生效
Posted by "张铎 (Duo Zhang)" <pa...@gmail.com>.
图好像看不到?
sudo rm -rf /* <le...@qq.com> 于2020年6月3日周三 上午10:00写道:
> 配置了队列隔离参数,参数如下:
> hbase.regionserver.handler.count 30
> hbase.ipc.server.callqueue.handler.factor 1
> hbase.ipc.server.callqueue.read.ratio 0.5
> hbase.ipc.server.callqueue.scan.ratio 0.1
>
> 这样我控制scan的线程为1,
> 此时,查看线程的分配情况
>
>
> 接着下运行测试代码,只有scan的操作。
> from happybase import ConnectionPool
> import time
>
> pool = ConnectionPool(size=1, host='ip', port=9090, timeout=2000)
> for i in range(200):
> start = time.time()
> try:
> with pool.connection(2000) as con:
> table = con.table("table_name")
> res = list(table.scan(filter="PrefixFilter('273810955|')",
>
> row_start='\x0f\x10&R\xca\xdf\x96\xcb\xe2\xad7$\xad9khE\x19\xfd\xaa\x87\xa5\xdd\xf7\x85\x1c\x81ku
> ^\x92k',
> limit=3))
> except Exception as e:
> pass
> end = time.time()
> print 'timeout: %d' % (end - start)
>
> 此时线程的运行情况
>
> 此时我们的CPU占用,已经被跑满了
> 为什么我配置了队列隔离,只运行scan操作,还会有请求占用get的处理线程,我们的目的是想要限制scan所使用的资源,但现在看来,好像没有生效
>
>