Finding the most accessed Table/Region on an HBase Region Server

来源: http://whynosql.com/finding-the-most-accessed-tableregion-on-an-hbase-region-server/

 

要翻墙!

 

Each HBase region server hosts many regions – possibly hundreds or even thousands. How do you find out which one of them is a hotspot? We saw that CPU on one of the region server was shooting up at peak traffic. But the region server had 4 tables (and hundreds of regions) and their access patterns were similar. Each web request was accessing all four of the tables. So how do you find out which table is the bottleneck? Which region(s) is causing hotspotting?

Unfortunately, HBase does not provide any tools for finding out which region is causing hotspotting. You can see HBase committers agreeing to this in this mailing list thread . You will have to simply monitor the traffic between your web servers and the region server and find out which table/region is being accessed the most.

Taking a clue from the mailing list thread, we found out which region is causing Hotspotting using ngrep command. Ngrep helps you sniff traffic. We first dumped a few seconds of ngrep output into a a file by executing the following command on the region server:

ngrep -W byline port 60020 > temp.out

This command created a file temp.out in the current directory. Note that the 60020 is the region server’s default port. -W byline option asks ngrep to organize information in lines. Once you have ngrep output on file, you can simply execute the following command to analyze it:


grep 'TableName,' temp.out | wc -l

The above command printed a count of lines containing “TableName, “. These many requests were made to the region server from client(s).

The reason we tried searching for “TableName, ” was because that’s how region names are named in HBase (as of 0.20.6). A region name is named as

[TableName],[key],[encoded region name]

Anytime a request is made to a region, you will find the region name in the request. This also means that the request will have the table name too. For us, finding out which table got the most traffic was sufficient. However, if you want to find out what the specific region is, you can easily come up with a few simple lines of code that can parse ngrep output (temp.out above) to give you the number of requests sent to each region.

【6层】一字型框架办公楼(含建筑结构图、计算书) 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值