HBase客户端访问超时的多个因素及参数
在一个需要低延时响应的hbase集群中,使用hbase默认的客户端超时配置简直就是灾难。
但是我们可以考虑在客户端上加上如下几个参数,去改变这种状况:
1. hbase.rpc.timeout: RPC timeout, The default 60s, 可以修改为5000(5s)
2. ipc.socket.timeout: Socket link timeout, should be less than or equal to RPC timeout, the default is 20s
3. hbase.client.retries.number: The number of retries, default is 14, 可以配置为1
4. hbase.client.pause: Sleep time again, the default is 1s, can be reduced, such as 100ms(在1.1版本的hbase已经变为100ms,请对照你使用的hbase版本)
5. zookeeper.recovery.retry: The number of retries ZK, Can be adjusted to 3 times, ZK is not easy to hang, And if HBase cluster problem, Each retry retry the operation of ZK will be, The total number of retry ZK is: hbase.client.retries.number * zookeeper.recovery.retry, And sleep time each retry will have exponential growth of 2, Every time you access the HBase will try again, In a HBase operation if it involves multiple ZK access, If ZK is not available, There will be many times the ZK retry, Is a waste of time.
6. zookeeper.recovery.retry.intervalmill: Sleep time ZK retries, the default is 1s, can be reduced, for example: 200ms
7. hbase.regionserver.lease.period: A scan query when interacting with server timeout, the default is 60s.(在1.1版本,该参数名为hbase.client.scanner.timeout.period)
Retry interval strategy RPC:
public static long getPauseTime(final long pause, final int tries) {
int ntries = tries;
// RETRY_BACKOFF[] = { 1, 1, 1, 2, 2, 4, 4, 8, 16, 32, 64 }
if (ntries >= HConstants.RETRY_BACKOFF.length) {
ntries = HConstants.RETRY_BACKOFF.length - 1;
}
long normalPause = pause * HConstants.RETRY_BACKOFF[ntries];
long jitter = (long)(normalPause * RANDOM.nextFloat() * 0.01f); // 1% possible jitter
return normalPause + jitter;
}
Retry interval strategy ZK:
// RetryCounter类
//Sleep time 指数级增长
public void sleepUntilNextRetry() throws InterruptedException {
int attempts = getAttemptTimes();
long sleepTime = (long) (retryIntervalMillis * Math.pow(2, attempts));
timeUnit.sleep(sleepTime);
}
// retriesRemaining, The default value ismaxReties, Each retry after reduction1
public int getAttemptTimes() {
return maxRetries-retriesRemaining+1;
}
HBase客户端访问超时的多个因素及参数的更多相关文章
- Java客户端访问HBase集群解决方案(优化)
测试环境:Idea+Windows10 准备工作: <1>.打开本地 C:\Windows\System32\drivers\etc(系统默认)下名为hosts的系统文件,如果提示当前用户 ...
- java request判断微信客户端访问
微信客户端访问时候user-agent信息如下: Mozilla/5.0 (Linux; Android 5.0.1; M040 Build/LRX22C) AppleWebKit/537.36 (K ...
- restTemplate设置访问超时
(一)RestTemplate 客户端 1.RestTemplate 是Spring的封装,需要spring的包 spring-web-3.0.7.RELEASE.jar 2.客户端代码: /** * ...
- .net core 下使用StackExchange的Redis库访问超时解决
原文:.net core 下使用StackExchange的Redis库访问超时解决 目录 问题:并发稍微多的情况下Redis偶尔返回超时 给出了参考网址? 结论 小备注 引用链接 问题:并发稍微多的 ...
- Linux服务器可以ping,但是telnet端口超时,网站wget超时,访问超时的解决办法
最近无法通过SSH连接Linux服务器,访问该服务器上的HTTP服务也出现异常.可以ping,但是telnet端口超时,网站wget超时,访问超时. 最后排查是内核配置问题 原来是 net.ipv4. ...
- [原创]用windows7连接windows2003的终端服务器时,出现"由于这台计算机没有远程桌面客户端访问许可证,远程会话被中断"的问题
用windows7连接windows2003的终端服务器时,出现"由于这台计算机没有远程桌面客户端访问许可证,远程会话被中断"的问题,原因是终端服务器授权方式设置为了"每 ...
- Windows Azure Virtual Network (10) 使用Azure Access Control List(ACL)设置客户端访问权限
<Windows Azure Platform 系列文章目录> 本文介绍的是国内由世纪互联运维的China Azure. 我们在创建完Windows Azure Virtual Machi ...
- Spring之在客户端访问RESTful业务
Spring之在客户端访问RESTful业务 RestTemplate 是客户端访问RESTful业务的核心类.在概念上与Spring其他的模板类相似,比如JdbcTemplate和JmsTempla ...
- C#完全无客户端访问Oracle
网上太多的C#无客户端访问oracle案例,经我测试无一成功,特将我在oracle官网上和自己琢磨总结,终于成功,废话不多说,直接上项目. 一,准备条件 (由于我这里是用的控制台程序来测试的,所以将上 ...
随机推荐
- Matlab 图象操作函数讲解
h = imrect;pos = getPosition(h); 这个函数用来获取图象上特定区域的坐标,其中pos的返回值中有四个参数[xmin,ymin,width,height],特定区域的左上角 ...
- scatter注记词
say illness thumb ginger brass atom twenty omit fine thought staff poverty
- C#调用mingw的so库时无法加载DLL###.so 找不到指定的模块
使用C#调用mingw的so,报了c# 无法加载DLL“###.so”,: 找不到指定的程序. (异常来自 HRESULT:0x8007007E)开始以为是dll路径问题,使用全路径确认正确后仍然无法 ...
- C中的除法,商和余数的大小、符号如何确定
对于C中的除法,商和余数的大小.符号是如何确定的呢?在C89中,只规定了如果两个数为正整数,那么余数的符号为正,并且商的值是接近真实值的最大整数.比如5 / 2,那么商就是2,余数就是1.但是,C89 ...
- eg_4
4. 编写一个程序,要求以树状结构展现特定的文件夹及其子文件(夹) import java.io.*; public class Test { public static void main(Stri ...
- lintcode-149-买卖股票的最佳时机
149-买卖股票的最佳时机 假设有一个数组,它的第i个元素是一支给定的股票在第i天的价格.如果你最多只允许完成一次交易(例如,一次买卖股票),设计一个算法来找出最大利润. 样例 给出一个数组样例 [3 ...
- python学习第二天-基本数据类型常用方法
1.直入主题 python中基本的数据类型有 数字(整形,长整形,浮点型,复数) 字符串 字节串:在介绍字符编码时介绍字节bytes类型 列表 元组 字典 集合 下面我们直接将以下面几个点进行学习 # ...
- noauth authentication required redis
解决方案: 这是出现了认证的问题,是因为设置了认证密码. 127.0.0.1:6379> auth "yourpassword" 例如:
- python爬虫-使用xpath方法
#coding=utf-8 import re from lxml import etree import requests response = requests.get("http:// ...
- try-with-resources语句
try-with-resources语句是一种声明了一种或多种资源的try语句.资源是指在程序用完了之后必须要关闭的对象.try-with-resources语句保证了每个声明了的资源在语句结束的时候 ...