当前位置:网站首页>Region 性能调优
Region 性能调优
2022-07-17 14:46:00 【添香小铺】
本文介绍了如何通过调整 Region 大小等方法对 Region 进行性能调优以及如何在大 Region 下使用 bucket 进行并发查询优化。
概述
TiKV 自动将底层数据进行分片,所有数据按照 key 的范围划分为若干个 Region。当某个 Region 的大小超过一定限制后,TiKV 会将它分裂为多个 Region。
在大量数据的场景下,可能会出现 Region 数量过多,从而带来更多的资源开销和导致性能回退的问题。在固定数据量下,Region 越大,则 Region 个数越少。从 v6.1.0 开始,TiDB 支持设置自定义的 Region 大小。Region 默认的大小约为 96 MiB,将其调大可以减少 Region 个数。
开启 Hibernate Region 或 Region Merge 也可以减少过多 Region 带来的性能开销。
使用 region-split-size 调整 Region 大小
警告
自定义 Region 大小是在 TiDB v6.1.0 引入的实验特性,不建议在生产环境中配置。使用此特性的风险包括:
- 更容易发生性能抖动。
- 查询性能回退,尤其是大范围数据查询的性能会有回退。
- 调度变慢。
Region 的大小可以通过 coprocessor.region-split-size 进行设置。推荐的 Region 大小为 96 MiB、128 MiB、256 MiB。region-split-size 越大,性能会越容易发生抖动。不推荐将 Region 大小设置超过 1 GiB,强烈建议不超过 10 GiB。如果你使用了 TiFlash,则 Region 大小不能超过 256 MiB。如果使用 Dumpling 工具,则 Region 大小不能超过 1 GiB。Region 调大以后,使用 Dumpling 工具时,需要降低并发,否则 TiDB 会有 OOM 的风险。
使用 bucket 增加并发
警告
当前该功能为实验特性,不建议在生产环境中使用。
Region 调大以后,为了增加查询并发,应当设置 coprocessor.enable-region-bucket 为 true。这个配置会将每个 Region 划分为更小的区间 bucket,并且以这个更小的区间作为并发查询单位,以提高扫描数据的并发度。bucket 的大小通过 coprocessor.region-bucket-size 来控制,默认值为 96MiB。
边栏推荐
猜你喜欢

SPI service discovery mechanism

A fastandrobust volutionalneuralnetwork based defect detection model inproductqualitycontrol reading notes

Tier defect detection using full revolutionary network

Learning outline of the column "MySQL DBA's magic road"

JVM hook hooks function

常用getshell工具的下载

Mysql索引的类型(单列索引、组合索引 btree索引 聚簇索引等)

性能优化之@Contended减少伪共享

Tire Defect Detection Using Fully Convolutional Network-论文阅读笔记

Leetcode 1252. 奇数值单元格的数目
随机推荐
Getting started with web security - deploy snort open source ids/ips system
开发那些事儿:如何解决RK芯片视频处理编解码耗时很长的问题?
Total number of blocking and waiting in jconsole thread panel (RPM)
Four methods of traversing key value in map
CodeForces - 587E(线性基+线段树+差分)
XSS.haozi.me刷题
Daily question brushing record (26)
MySQL autoincrement ID, UUID and snowflake ID
zabbix代理服务器配置
Antd form setting array fields
Hello JSON Schema
Tier defect detection using full revolutionary network
A fastandrobust convolutionalneuralnetwork-based defect detection model inproductqualitycontrol-閱讀筆記
Similarities and differences between OA system and MES system
翻墙后看什么?最热门的国外网站——翻墙网址导航
Dream CMS foreground search SQL injection
【二叉树】之力扣牛客必刷题
Unity high version returned low version error
Detailed explanation of MySQL show processlist
OA系统与MES系统的异同点