当前位置:网站首页>Load Base Split usage documentation
Load Base Split usage documentation
2022-07-30 15:52:00 【Tim's Shop】
Load Base Split is a feature introduced by TiKV in version 4.0, which aims to solve the hotspot problem caused by the uneven distribution of Region access, such as full table scan of small tables.
scene description
In TiDB, it is easy to form hot spots when traffic is concentrated on certain nodes.PD will try to distribute Hot Regions as evenly as possible on each node by scheduling Hot Regions, in order to obtain better performance.
But the smallest granularity of PD scheduling is Region.If the number of hotspots in the cluster is less than the number of nodes, or if there are some hotspots whose traffic is much higher than other regions, all that can be done for the PD's hotspot scheduling is to transfer the hotspots from one node to another.Unable to put the load on the entire cluster.
This scenario is especially common in workloads with many read requests.For example, full table scans and index lookups for small tables, or frequent access to some fields.
The previous solution to this problem was to manually enter commands to split one or several hotspot regions, but there are two problems in this operation:
- Evenly splitting Regions is not necessarily the best choice. Requests may be concentrated on certain keys. Even after evenly splitting, the hot spots may still be concentrated on one of the Regions, which may require multiple evenly splitting.Achieve goals.
- Human intervention is not timely and easy to use.
implementation principle
Load Base Split will automatically split Regions based on statistics.Identify those Regions whose read traffic continues to exceed the threshold within 10s through statistics, and split these Regions at appropriate locations.When choosing the location of the split, we will try to balance the access volume of the two regions after the split, and try to avoid cross-region access.
Regions after Load Base Split will not be merged quickly.On the one hand, the PD's MergeChecker will skip the hot Region, and on the other hand, the PD will also judge the QPS in the heartbeat information to avoid Merge two QPS Very high Region.
How to use
The current control parameters for Load Base Split are split.qps-threshold (QPS threshold) and split.byte-threshold (traffic threshold).If the sum of various read requests per second in a region exceeds the QPS threshold or the traffic threshold within 10 consecutive seconds, the region will be split.
Currently, Load Base Split is enabled by default, but the configuration is relatively conservative. split.qps-threshold defaults to 3000, split.byte-thresholdThe default is 30MB/s.If you want to turn off this feature, set both thresholds high enough.
There are currently two ways to modify the configuration:
Modify by SQL statement, for example:
set config tikv split.qps-threshold=3000Modified by TiKV, eg:
curl -X POST "http://ip:status_port/config" -H "accept: application/json" -d '{"split.qps-threshold":"3000"}'
Similarly, there are currently two ways to view the configuration:
View via SQL, eg:
show config where type='tikv' and name like '%split.qps-threshold%'View via TiKV, eg:
curl "http://ip:status_port/config"
Note
Since v4.0.0-rc.2, you can use SQL statements to modify and view the configuration.
边栏推荐
猜你喜欢
随机推荐
Example of video switching playback (video switching example) code
70行代码撸一个桌面自动翻译神器
Sleuth+Zipkin (visualization) service link tracking
TiUP 简介
php如何去除字符串最后一位字符
Debug - Notes
Overview of TiUP commands
Flask introductory learning tutorial
编译、链接 - 笔记 - 3
解析字符串拼接的两种情况
Applicable scenarios of TiDB tools
Databases - create databases, tables, functions, etc.
【喂到嘴边了的模块】准备徒手撸GUI?用Arm-2D三分钟就够了
Use of InputStream and OutputStream
tiup clean
Classes and Objects (Part 2)
微服务该如何拆分?
RISC-V调用惯例
TiDB 工具下载
FME实现CAD带属性转SHP数据方法









