【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
TiDB 视图统计大小、监控中显示大小、实际磁盘占用空间思考?发现实际占用空间比与视图,与监控中的空间对上。请问怎么准确统计表大小、数据库大小?
磁盘34 GB 监控49 视图142 。视图与监看的比例约3:1
集群信息:
Starting component cluster
: /home/tidb/.tiup/components/cluster/v1.12.3/tiup-cluster display lbtest
Cluster type: tidb
Cluster name: lbtest
Cluster version: v6.5.3
Deploy user: tidb
SSH type: builtin
Dashboard URL: http://xxxxxxxxxx:2479/dashboard
Grafana URL: http://xxxxxxxxxx:3000
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir
xxxxxxxxxx:3000 grafana xxxxxxxxxx 3000 linux/x86_64 Up - /data/tidb-deploy/grafana-3000
xxxxxxxxxx:2379 pd xxxxxxxxxx 2379/2380 linux/x86_64 Up|L /data/tidb-data/pd-2379 /data/tidb-deploy/pd-2379
xxxxxxxxxx:2479 pd xxxxxxxxxx 2479/2480 linux/x86_64 Up|UI /data/tidb-data/pd-2479 /data/tidb-deploy/pd-2479
xxxxxxxxxx:9090 prometheus xxxxxxxxxx 9090/12020 linux/x86_64 Up /data/tidb-data/prometheus-9090 /data/tidb-deploy/prometheus-9090
xxxxxxxxxx:4000 tidb xxxxxxxxxx 4000/10080 linux/x86_64 Up - /data/tidb-deploy/tidb-4000
xxxxxxxxxx:5000 tidb xxxxxxxxxx 5000/10081 linux/x86_64 Up - /data/tidb-deploy/tidb-5000
xxxxxxxxxx:20160 tikv xxxxxxxxxx 20160/20180 linux/x86_64 Up /data/tidb-data/tikv-20160 /data/tidb-deploy/tikv-20160
xxxxxxxxxx:20161 tikv xxxxxxxxxx 20161/20181 linux/x86_64 Up /data/tidb-data/tikv-20161 /data/tidb-deploy/tikv-20161
xxxxxxxxxx:20162 tikv xxxxxxxxxx 20162/20182 linux/x86_64 Up /data/tidb-data/tikv-20162 /data/tidb-deploy/tikv-20162
视图查询数据库总大小:142GB
普罗米修斯监控:49.2GB
磁盘存储信息:
统计db 占用磁盘空间大小:34GB
[tidb@xxxxxxxxxxxx tidb-data]$ du -sh *
4.0K cdc-data
4.0K monitor-9100
414M pd-2379
485M pd-2479
36G prometheus-9090
101G tikv-20160
98G tikv-20161
97G tikv-20162
[tidb@xxxxxxxxxxxx tidb-data]$
[tidb@xxxxxxxxxxxx tidb-data]$ cd tikv-20160
**[tidb@xxxxxxxxxxxx tikv-20160]$ du -sh ***
11G db
12K import
20K last_tikv.toml
0 LOCK
0 raftdb.info
6.9G raft-engine
301M rocksdb-2023-07-28T16-12-18.302.info
301M rocksdb-2023-09-08T10-48-42.537.info
301M rocksdb-2023-10-13T00-09-34.548.info
301M rocksdb-2023-11-21T02-57-02.361.info
301M rocksdb-2023-12-27T18-13-02.481.info
146M rocksdb.info
4.0K snap
82G space_placeholder_file
[tidb@xxxxxxxxxxxx tikv-20160]$ cd …/tikv-20161
**[tidb@xxxxxxxxxxxx tikv-20161]$ du -sh ***
11G db
12K import
20K last_tikv.toml
0 LOCK
0 raftdb.info
4.4G raft-engine
301M rocksdb-2023-07-27T20-22-10.824.info
301M rocksdb-2023-09-04T21-20-42.265.info
301M rocksdb-2023-10-10T13-52-08.023.info
301M rocksdb-2023-11-19T15-42-26.124.info
301M rocksdb-2023-12-28T07-15-21.382.info
141M rocksdb.info
4.0K snap
82G space_placeholder_file
[tidb@xxxxxxxxxxxx tikv-20161]$ cd …/tikv-20162
**[tidb@xxxxxxxxxxxx tikv-20162]$ du -sh ***
12G db
12K import
20K last_tikv.toml
0 LOCK
0 raftdb.info
2.5G raft-engine
301M rocksdb-2023-07-27T20-09-17.561.info
301M rocksdb-2023-09-06T05-07-10.879.info
301M rocksdb-2023-10-15T01-26-02.859.info
301M rocksdb-2023-11-22T23-59-09.160.info
301M rocksdb-2023-12-29T07-30-34.125.info
139M rocksdb.info
4.0K snap
82G space_placeholder_file