Opentsdb官方优化文档 - 翻译
文档地址 :
Tuning — OpenTSDB 2.4 documentation
Tuning
As with any database there are many tuning parameters for OpenTSDB that can be used to improve write and read performance. Some of these options are specific to certain backends, others are global.
翻译:
与任何数据库一样,OpenTSDB有许多调优参数可用于提高写和读性能。其中一些选项是特定于某些后端的,另一些则是全局的。
TSDB Memory
As with any server process, tuning the TSD’s memory footprint is important for a successful install. There are a number of caches in OpenTSDB that can be tuned.
翻译:
与任何服务器进程一样,调整TSD的内存占用对于成功安装非常重要。OpenTSDB中有许多缓存可以进行调优
UID Caches
OpenTSDB saves space in storage by converting strings to binary UIDs. However for writing and querying, these UIDs have to be cached to improve performance (otherwise every operation would amplify queries against storage). In early versions of OpenTSDB, the cache would maintain an unbounded map of strings to UIDs and UIDs to strings regardless of modes of operation. In 2.4 you can choose how much data to cache and optionally use an LRU. The pertinent settings include:
-
‘tsd.uid.use_mode=true’ - When this is set to true, the tsd.mode value is examined to determine if either or both of the forward (string to UID) and reverse (UID to string) maps are populated. When empty or set to rw, both maps are populated. When set to ro, only the reverse map is populated (as query results need caching). When in w or write-only mode, only the forward map is populated as metrics need to find their UIDs when writing.
-
tsd.uid.lru.enable=true - Switch to the LRU version of the cache that will expire entries that haven’t been read in a while.
-
tsd.uid.lru.id.size=<integer> - For TSDs focused on reads, set this size larger than tsd.uid.lru.name.size.
-
tsd.uid.lru.name.size=<integer> - For TSDs focused on writes, set this size larger than the tsd.uid.lru.id.size.
翻译:
OpenTSDB通过将字符串转换为二进制UID来节省存储空间。然而,对于写入和查询,必须缓存这些UID以提高性能(否则,每个操作都会放大对存储的查询)。在早期版本的OpenTSDB中,无论操作模式如何,缓存都会维护字符串到UID和UID到字符串的无边界映射。在2.4中,您可以选择缓存多少数据,也可以选择使用LRU。相关设置包括:
“tsd.uid.use_mode=true”-如果设置为true,将检查tsd.mode值,以确定是否填充正向(字符串到uid)和反向(uid到字符串)映射中的一个或两个。当为空或设置为rw时,将填充两个映射。当设置为ro时,只填充反向映射(因为查询结果需要缓存)。当处于w或仅写模式时,由于写入时度量需要找到其UID,因此仅填充前向映射。
tsd.uid.lru.enable=true-切换到缓存的lru版本,该版本将使一段时间内未读取的条目过期。
tsd.uid.lru.id.size=<integer>-对于专注于读取的tsd,请将此大小设置为大于tsd.uid.lou.name.size。
tsd.uid.lru.name.size=<integer>-对于专注于写入的tsd,请将此大小设置为大于tsd.uid.loi.id.size。
HBase Storage
These are parameters to look at for using OpenTSDB with Apache HBase.
Date Tierd Compaction
HBase is an LSM store meaning data is written to blocks in memory, then flushed in blocks to disk, then periodically those blocks on disk are merged into fewer blocks to reduce file count and redundancies. The process of reading and merging blocks from disk can consume a fair amount of CPU and memory so if a system is heavily loaded with time series write traffic, background compactions can begin to impact write performance. HBase offers various compaction strategies including Date Tiered Compaction that looks at the the edit timestamps of columns to figure out if stale file that haven’t been modified should be ignored and arranges data so that time ranged queries are much more efficient.
OpenTSDB can leverage this compaction strategy (as of 2.4) to improve HBase performance, particularly for queries. To setup Date Tiered Compaction in HBase, see HBase Book. Parameters that must be set in the OpenTSDB config include:
-
tsd.storage.use_otsdb_timestamp=true - By default the edit timestamps of every data point is now. This changes the timestamp to be that of the actual data point. Note that rollups do not use this strategy yet.
-
tsd.storage.get_date_tiered_compaction_start=<Unix Epoch MS timestamp> - A timestamp in milliseconds when the date tiered compactor was enabled on a table. If you are creating a brand new table for OpenTSDB you can leave this at the default of 0.
HBase是一种LSM存储,意味着数据被写入内存中的块,然后在块中刷新到磁盘,然后定期将磁盘上的这些块合并为更少的块,以减少文件数量和冗余。从磁盘读取和合并块的过程可能会消耗相当多的CPU和内存,因此,如果系统负载了大量时间序列写入流量,则后台压缩可能会开始影响写入性能。HBase提供了各种压缩策略,包括日期分层压缩,它查看列的编辑时间戳,以确定是否应该忽略尚未修改的陈旧文件,并排列数据,从而使时间范围的查询更加高效。
OpenTSDB可以利用这种压缩策略(从2.4开始)来提高HBase的性能,特别是对于查询。要在HBase中设置日期分层压缩,请参阅HBase Book。必须在OpenTSDB配置中设置的参数包括:
tsd.storage.use_otsdb_timestamp=true-默认情况下,每个数据点的编辑时间戳为现在。这会将时间戳更改为实际数据点的时间戳。请注意,汇总尚未使用此策略。
tsd.storage.get_date_tiered_compaction_start=<Unix Epoch MS时间戳>-在表上启用日期分层压缩程序时的时间戳(以毫秒为单位)。如果您正在为OpenTSDB创建一个全新的表,您可以将其保留为默认值0。
HBase Read/Write Queues
HBase has the ability to split the queues that handle RPCs for writes (mutations) and reads. This is a huge help for OpenTSDB as massive queries will avoid impacting writes and vice-versa. See the HBase Book for various configuration options. Note that different HBase versions have different names for these properties.
Possible starting values are 50% or 60%. E.g. hbase.ipc.server.callqueue.read.share=0.60 or hbase.ipc.server.callqueue.read.ratio=0.60 depending on HBase version.
Also, tuning the call queue size and threads is important. With a large queue, the region server can possibly OOM (if there are a large number of writes backing up) and RPCs will be more likely to time out on the client side if they sit in the queue too long. The queue size is a factor of the number of handlers. Reducing the call queue size also helps to cause clients to throttle, particularly the AsyncHBase client. For HBase 1.3 a good setting may be hbase.ipc.server.max.callqueue.length=100 and hbase.ipc.server.read.threadpool.size=2. If you need to increase the threads, reduce the queue length as well.
翻译:
HBase能够拆分处理写(突变)和读的RPC的队列。这对OpenTSDB来说是一个巨大的帮助,因为大量查询将避免影响写入,反之亦然。有关各种配置选项,请参阅HBase Book。请注意,不同的HBase版本对这些属性有不同的名称。
可能的起始值为50%或60%。例如,hbase.ipc.server.callqueue.read.share=0.60或hbase.iipc.server.callequeue.read.tratio=0.60,具体取决于hbase版本。
此外,调整调用队列大小和线程也很重要。对于大队列,区域服务器可能会OOM(如果有大量写入备份),如果RPC在队列中停留的时间过长,则更有可能在客户端超时。队列大小是处理程序数量的一个因素。减少调用队列大小也有助于导致客户端节流,尤其是AsyncHBase客户端。对于HBase 1.3,一个好的设置可能是HBase.ipc.server.max.callqueue.length=100和HBase.iipc.server.read.threadpool.size=2。如果需要增加线程,也可以减少队列长度。
HBase Cache
Tuning the HBase cache is also important for queries as you want to avoid reading data off disk as much as possible (particularly if that disk is S3). Try using the offheap cache via hbase.bucketcache.combinedcache.enabled=true and hbase.bucketcache.ioengine=offheap. Give the offheap cache a good amount of RAM, e.g. hbase.bucketcache.size=4000 for 4GB of RAM. Since the most recent data is usually queried when reading time series, it’s a good idea to populate the block cache on writes and use most of that space for the latest data. Try the following settings:
hbase.rs.cacheblocksonwrite=true hbase.rs.evictblocksonclose=false hfile.block.bloom.cacheonwrite=true hfile.block.index.cacheonwrite=true hbase.block.data.cachecompressed=true hbase.bucketcache.blockcache.single.percentage=.99 hbase.bucketcache.blockcache.multi.percentage=0 hbase.bucketcache.blockcache.memory.percentage=.01 hfile.block.cache.size=.054 #ignored but needs a value.
This will allocate the majority of the black cache for writes and cache it in memory.
For the on-heap cache, you can try an allocation of:
hbase.lru.blockcache.single.percentage=.50 hbase.lru.blockcache.multi.percentage=.49 hbase.lru.blockcache.memory.percentage=.01
翻译:
调整HBase缓存对于查询也很重要,因为您希望尽可能避免从磁盘上读取数据(尤其是当磁盘是S3时)。尝试通过hbase.backetcache.cocombinedcache.enabled=true和hbase.blocketcache.ioengine=offheap使用堆外缓存。为堆外缓存提供充足的RAM,例如,对于4GB的RAM,hbase.bocketcache.size=4000。由于读取时间序列时通常会查询最新的数据,因此最好在写入时填充块缓存,并将大部分空间用于最新数据。请尝试以下设置:
HBase Compaction
Compaction is the process of merging multiple stores on disk for a region into fewer files to reduce space and query times. You can tune the number of threads and thresholds for compaction to avoid using too many resources when the focus should be on writes.
hbase.hstore.compaction.ratio=1.2 hbase.regionserver.thread.compaction.large=2 hbase.regionserver.thread.compaction.small=6 hbase.regionserver.thread.compaction.throttle=524288000
压缩是将一个区域的磁盘上的多个存储合并为更少的文件以减少空间和查询时间的过程。您可以调整线程数量和压缩阈值,以避免在应该将重点放在写入上时使用过多资源。
HBase Regions
For OpenTSDB we’ve observed that 10G regions are a good size for a large cluster hbase.hregion.max.filesize=10737418240.
翻译:
对于OpenTSDB,我们已经观察到10G区域对于大型集群hbase.hregion.max.filesize=1037418240来说是一个不错的大小。
HBase Memstore
Try flushing the mem store to disk (and cache) more often, particularly for heavy write loads. We’ve seen good behavior with 16MBs hbase.hregion.memstore.flush.size=16777216. Also try reducing the memstore size limit via hbase.regionserver.global.memstore.lowerLimit=.20 and hbase.regionserver.global.memstore.upperLimit=.30.
翻译:
请尝试更频繁地将内存存储刷新到磁盘(和缓存),尤其是在写负载很大的情况下。我们已经看到了16MB hbase.hregion.memstore.flash.size=16777216的良好性能。也可以尝试通过hbase.regiserver.global.membestore.lowerLimit=.20和hbase.reregionserver.global-memstore.upperLimit=.30来减少内存存储大小限制。
相关文章:
Opentsdb官方优化文档 - 翻译
文档地址 : Tuning — OpenTSDB 2.4 documentation Tuning As with any database there are many tuning parameters for OpenTSDB that can be used to improve write and read performance. Some of these options are specific to certain backends, others are global. …...
JavaScript深拷贝与浅拷贝的全面解析
🧑🎓 个人主页:《爱蹦跶的大A阿》 🔥当前正在更新专栏:《VUE》 、《JavaScript保姆级教程》、《krpano》 目录 ✨ 前言 ✨ 正文 浅拷贝 对象的浅拷贝 数组的浅拷贝 浅拷贝的问题 深拷贝 什么是深拷贝…...
ESU毅速丨制造企业需不需要建设增材制造中心?
随着科技的不断发展,增材制造技术已经成为制造行业的新宠。越来越多的企业开始考虑建设增材制造中心,以提高生产效率、降低成本、加速产品创新。但是,对于制造企业来说,是否需要建设增材制造中心呢? 首先,我…...
Linux shell编程学习笔记39:df命令
0 前言1 df命令的功能、格式和选项说明 1.1 df命令的功能1.2 df命令的格式1.3 df命令选项说明 2 df命令使用实例 2.1 df:显示主要文件系统信息2.2 df -a:显示所有文件系统信息2.3 df -t[]TYPE或--type[]TYPE:显示TYPE指定类型的文件系统信…...
简单高效 LaTeX 科学排版 第004集 命令与环境
这是《简单高效LaTeX》的第四个视频,主要演示讨论基本命令与排版环境,还有保留字符。 视频地址:https://www.ixigua.com/7298100920137548288?id7298102807985390120&logTagf853f23a668f8a2ee405...
初识XSS漏洞
目录 一、XSS的原理和分类 二、Xss漏洞分类 1. 反射性xss 简单的演示: 2.基于DOM的XSS 简单的演示: 3.存储型XSS 编辑简单的演示 4、self xss 三、XSS漏洞的危害 四、XSS漏洞的验证 五、XSS漏洞的黑盒测试 六、XSS漏洞的白盒测试 七、XS…...
白嫖aws创建Joplin server服务器
网上有很多的Joplin服务器的搭建教程,但是基本都是抄来抄去,对初学者实在是太不友好了。 话不多说,说干就干,自己从头找资料搭了一个,这可能是全网最好的Joplin服务器搭建教程了。 aws服务器 aws的服务器还是很香的&…...
metartc5_jz源码阅读-p2p通过stun服务器进行通信
1. YangIpc.c/yang_create_ipc 需要设置stun服务器的ip地址和端口号 设置iceCandidateType为2,表示走stun,即向stun服务器发起请求获取本机的公网ip地址。 //设置iceServerIP和端口号,设置iceCandidate类型。 strcpy(session->avinfo.rtc…...
总结:Java程序员读书清单顺序
总结:Java程序员读书清单顺序,持续更新中。。。。。。 一经验提示:1.零基础不建议直接看计算机专业书籍,建议先去看视频教程2.本书单目录用作自学顺序记录,也适用于有Java开发基础的同志3.看计算机书籍可以完善自己的技…...
ubuntu通过virtualbox安装win虚拟机
系统:Ubuntu22.04 需要准备:下载你想用的windows的iso镜像,官方传送门。 一、安装virtualbox sudo apt-get install virtualbox安装完成后,打开Applications,找到virtualbox,点击启动 二、安装windows虚…...
云流量回溯的工作原理及关键功能
云计算和网络技术的快速发展为企业提供了更灵活、高效的业务运营环境,同时也引发了一系列网络安全挑战。在这个背景下,云流量回溯成为网络安全领域的一个关键技术,为企业提供了对网络活动的深入洞察和实时响应的能力。 一、 云流量回溯的基本…...
DCP文件传输的重要性与应用
在数字时代,文件传输已成为商业运作中不可或缺的一环。随着企业越来越多地采用云基础设施和服务,有效地在云和团队之间传输大文件和数据集变得至关重要。在这一背景下,数据复制协议(DCP)文件传输应运而生,引…...
JAVA面试部分——后端-线程后篇
3.12 如果在运行当中,遇到线程不够了,会以什么样的方式创建线程 线程池在运行过程中,如果遇到线程不够的情况,会根据线程池的类型和配置进行不同的处理: 对于固定大小的线程池:如果线程因异常结束ÿ…...
C语言辨析——深入理解字符常量与表达式
1. 问题 今天看到一个题目,截图如下。 从答题情况来看,本题的答案是B,那么就意味着A、C、D是错的。但我认为这4个选项都是对的。当然,如果要从4个选项中挑选一个的话,那还是选择B妥当一些。 2. 分析 字符常量的定义…...
Springboot + websocket 实现 一对一 单人聊天
Springboot websocket 实现 一对一 单人聊天 要使用websocket ,需要添加 jar 打开项目中的pom.xml,添加以下内容 创建java端代码 配置websocke的endpoints 配置websocket的server ServerEndpoint(value "/websocket/{username}") 这句话 一定要注意, 这里 路…...
GEE机器学习——利用最短距离方法进行土地分类和精度评定
最短距离方法 最短距离方法(Minimum Distance)是一种常用的模式识别算法,用于计算样本之间的相似度或距离。该方法通过计算样本之间的欧氏距离或其他距离度量,来确定样本之间的相似程度或差异程度。 最短距离方法的具体步骤如下: 1. 数据准备:收集并准备用于训练的数据…...
数据结构时间复杂度与空间复杂度
文章目录 引入算法 1、时间复杂度1.概念2.大O渐进表示法3.常见时间复杂度计算举例 2、空间复杂度1.概念2.常见空间复杂度计算举例 引入 算法 算法就是一段能将一个物体从初始状态转换到某个目标转态的一个有限长序列方法的统称 算法效率:考虑一个方法是否好&…...
【计算机网络】内容整理
概述 分组交换 分组交换则采用存储转发(整个包必须到达路由器,然后才能在下一个链路上传输)技术。 在发送端,先把较长的报文划分成较短的、固定长度的数据段。 电路交换 在端系统间通信会话期间,预留了端系统间沿路径通信所需…...
【K12】Python写分类电阻问题的求解思路解析
分压电阻类电路问题python程序写法 一个灯泡的电阻是20Ω,正常工作的电压是8V,正常工作时通过它的电流是______A。现在把这个灯泡接到电压是9V的电源上,要使它正常工作,需要给它______联一个阻值为______的分压电阻。 解决思想 …...
数据库面经---10则
数据库范式有哪些: 第一范式(1NF): 数据表中的每一列都是不可分割的原子值。每一行数据在关系表中都有唯一标识,通常是通过主键来实现。第二范式(2NF): 满足第一范式。…...
在软件开发中正确使用MySQL日期时间类型的深度解析
在日常软件开发场景中,时间信息的存储是底层且核心的需求。从金融交易的精确记账时间、用户操作的行为日志,到供应链系统的物流节点时间戳,时间数据的准确性直接决定业务逻辑的可靠性。MySQL作为主流关系型数据库,其日期时间类型的…...
(二)TensorRT-LLM | 模型导出(v0.20.0rc3)
0. 概述 上一节 对安装和使用有个基本介绍。根据这个 issue 的描述,后续 TensorRT-LLM 团队可能更专注于更新和维护 pytorch backend。但 tensorrt backend 作为先前一直开发的工作,其中包含了大量可以学习的地方。本文主要看看它导出模型的部分&#x…...
Objective-C常用命名规范总结
【OC】常用命名规范总结 文章目录 【OC】常用命名规范总结1.类名(Class Name)2.协议名(Protocol Name)3.方法名(Method Name)4.属性名(Property Name)5.局部变量/实例变量(Local / Instance Variables&…...
【JavaSE】绘图与事件入门学习笔记
-Java绘图坐标体系 坐标体系-介绍 坐标原点位于左上角,以像素为单位。 在Java坐标系中,第一个是x坐标,表示当前位置为水平方向,距离坐标原点x个像素;第二个是y坐标,表示当前位置为垂直方向,距离坐标原点y个像素。 坐标体系-像素 …...
均衡后的SNRSINR
本文主要摘自参考文献中的前两篇,相关文献中经常会出现MIMO检测后的SINR不过一直没有找到相关数学推到过程,其中文献[1]中给出了相关原理在此仅做记录。 1. 系统模型 复信道模型 n t n_t nt 根发送天线, n r n_r nr 根接收天线的 MIMO 系…...
大语言模型(LLM)中的KV缓存压缩与动态稀疏注意力机制设计
随着大语言模型(LLM)参数规模的增长,推理阶段的内存占用和计算复杂度成为核心挑战。传统注意力机制的计算复杂度随序列长度呈二次方增长,而KV缓存的内存消耗可能高达数十GB(例如Llama2-7B处理100K token时需50GB内存&a…...
安卓基础(aar)
重新设置java21的环境,临时设置 $env:JAVA_HOME "D:\Android Studio\jbr" 查看当前环境变量 JAVA_HOME 的值 echo $env:JAVA_HOME 构建ARR文件 ./gradlew :private-lib:assembleRelease 目录是这样的: MyApp/ ├── app/ …...
招商蛇口 | 执笔CID,启幕低密生活新境
作为中国城市生长的力量,招商蛇口以“美好生活承载者”为使命,深耕全球111座城市,以央企担当匠造时代理想人居。从深圳湾的开拓基因到西安高新CID的战略落子,招商蛇口始终与城市发展同频共振,以建筑诠释对土地与生活的…...
【网络安全】开源系统getshell漏洞挖掘
审计过程: 在入口文件admin/index.php中: 用户可以通过m,c,a等参数控制加载的文件和方法,在app/system/entrance.php中存在重点代码: 当M_TYPE system并且M_MODULE include时,会设置常量PATH_OWN_FILE为PATH_APP.M_T…...
解析奥地利 XARION激光超声检测系统:无膜光学麦克风 + 无耦合剂的技术协同优势及多元应用
在工业制造领域,无损检测(NDT)的精度与效率直接影响产品质量与生产安全。奥地利 XARION开发的激光超声精密检测系统,以非接触式光学麦克风技术为核心,打破传统检测瓶颈,为半导体、航空航天、汽车制造等行业提供了高灵敏…...
