Skip to content

Commit

Permalink
Cut down mark_cache default size and add the corresponding metrics in…
Browse files Browse the repository at this point in the history
… grafana (#7005)

ref #6426
  • Loading branch information
hongyunyan authored Mar 13, 2023
1 parent a7642ef commit 3737e0c
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dbms/src/Core/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static constexpr UInt64 DEFAULT_DISAGG_TASK_TIMEOUT_SEC = 3600;

#define PLATFORM_NOT_SUPPORTED "The only supported platforms are x86_64 and AArch64 (work in progress)"

#define DEFAULT_MARK_CACHE_SIZE (5ULL * 1024 * 1024 * 1024)
#define DEFAULT_MARK_CACHE_SIZE (1ULL * 1024 * 1024 * 1024)

#define DEFAULT_METRICS_PORT 8234

Expand Down
4 changes: 2 additions & 2 deletions etc/config-template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
## The TiFlash HTTP service port.
# http_port = 8123
## The cache size limit of the metadata of a data block. Generally, you do not need to change this value.
# mark_cache_size = 5368709120
# mark_cache_size = 1073741824
## The cache size limit of the min-max index of a data block. Generally, you do not need to change this value.
# minmax_index_cache_size = 5368709120
# minmax_index_cache_size = 1073741824
## The path in which the TiFlash temporary files are stored. By default it is the first directory in storage.latest.dir appended with "/tmp".
# tmp_path = "/tidb-data/tiflash-9000/tmp"

Expand Down
151 changes: 151 additions & 0 deletions metrics/grafana/tiflash_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -7416,6 +7416,157 @@
"percentage": false,
"steppedLine": false,
"description": "Information about schema of column file, to learn the memory usage of schema"
},
{
"aliasColors": {},
"dashLength": 10,
"datasource": "${DS_TEST-CLUSTER}",
"description": "cache misses or cache hits of mark_cache.\nBased on this infactor, we can check whether mark_cache is large enough",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"fill": 1,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 72
},
"id": 169,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"pluginVersion": "7.5.11",
"pointradius": 2,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"targets": [
{
"exemplar": true,
"expr": "max(tiflash_system_profile_event_MarkCacheMisses{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}) by (instance)",
"interval": "",
"legendFormat": "mark cache misses",
"queryType": "randomWalk",
"refId": "A"
},
{
"exemplar": true,
"expr": "max(tiflash_system_profile_event_MarkCacheHits{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "mark cache hits",
"refId": "B"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Effectiveness of Mark Cache",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percentunit",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true,
"$$hashKey": "object:259"
},
{
"format": "percent",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false,
"$$hashKey": "object:260"
}
],
"yaxis": {
"align": false,
"alignLevel": null
},
"bars": false,
"dashes": false,
"fillGradient": 0,
"hiddenSeries": false,
"percentage": false,
"points": false,
"stack": false,
"steppedLine": false,
"timeFrom": null,
"timeShift": null,
"transformations": [
{
"id": "calculateField",
"options": {
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"binary": {
"left": "mark cache misses",
"operator": "+",
"right": "mark cache hits",
"reducer": "sum"
},
"alias": "mark cache count total"
}
},
{
"id": "calculateField",
"options": {
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"binary": {
"left": "mark cache hits",
"operator": "/",
"right": "mark cache count total",
"reducer": "sum"
},
"alias": "mark cache effectiveness"
}
},
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"Time",
"mark cache effectiveness"
]
}
}
}
]
}
],
"repeat": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/docker/config/tics_dt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "107374182400" # 100GB
mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

Expand Down
4 changes: 2 additions & 2 deletions tests/docker/config/tiflash_dt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ capacity = "10737418240"
# path = "/tmp/tiflash/data/db,/tmp/tiflash1,/tmp/tiflash2"
# capacity = "0"

mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

Expand Down
4 changes: 2 additions & 2 deletions tests/docker/config/tiflash_dt_async_grpc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

Expand Down
4 changes: 2 additions & 2 deletions tests/docker/config/tiflash_dt_disable_local_tunnel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

Expand Down
4 changes: 2 additions & 2 deletions tests/docker/config/tiflash_dt_disable_planner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

Expand Down

0 comments on commit 3737e0c

Please sign in to comment.