Summary:
This article will help you understand the different storage size metrics you see in YugabyteDB Anywhere (YBA) and the native YugabyteDB web UIs. It’s written for anyone new to YugabyteDB or distributed databases and is useful for troubleshooting, planning, or just learning how your data is stored and reported.
Table of Contents
- Summary
- Test Data and Cluster Setup
- Why Not Use PostgreSQL’s Table Size Commands Directly?
- What Are SST Files?
- What Are WAL Files?
- YugabyteDB Anywhere (YBA) UI
- Native YugabyteDB Web UIs
- Storage Components Explained
- Behaviors and Common Questions
- Checking Sizes on Disk (Command Line)
- Frequently Asked Questions (FAQ)
- Understanding Size Units (MB/GB vs MiB/GiB)
- Additional Links
Test Data and Cluster Setup
Let’s start with a simple example:
-
Data Generation: To test YugabyteDB storage metrics, we generated about 61GB of raw data using a tool described in this blog post.
Here’s the command we used to create and load the data into a table called
demo1:$ gen_pg 100 60 10000000 demo1 | wc -c | numfmt --to=si 61G
-
Cluster Details: For our example, we used a cluster with a replication factor of 3 (3RF) to demonstrate the real world example.
What Are SST Files?
SST stands for Sorted String Table. These files are used by YugabyteDB to store table data on disk.
- Each SST set includes a small metadata/index file (ending in
.sst) - The actual data is in one or more data files (ending in
.sst.sblock.*)
Why does this matter?
The data files are much larger than the index file. When you want to know how much space your table uses, you need to count both.
How does YugabyteDB report this?
YugabyteDB’s metrics add up the sizes of all these files so what you see in the UI matches what’s on disk.
Example:
-
000082.sst(index): 4.5MB -
000082.sst.sblock.0(data): 6.0GB - Total: 6.34GB
What Are WAL Files?
WAL stands for Write-Ahead Log. WAL files store changes before they are written to SST files. This helps protect your data if there’s a crash or power failure.
There are two types of WAL files:
- Active (writable): Being written to right now
- Closed (readable): Finished and ready for recovery
YugabyteDB’s WAL metrics include the sizes of both active and closed files, so what you see in the UI matches what’s actually stored.
1. YugabyteDB Anywhere (YBA) UI
YBA is your main web interface for managing YugabyteDB clusters. Here’s how to read the storage metrics:
Universe > Nodes Page
Shows storage for each node:
SST Size: Total size of all SST files for all tables on the node
Uncompressed SST Size: How large your data would be if not compressed (usually much bigger)
Universe > Tables Page
Shows storage for each table:
SST Size: Size of all SST files for the table (includes every replica and node)
WAL Size: Size of all WAL files for the table (includes every replica and node)
Universe Overview Page
-
Data Disk Usage: Total disk space used by YugabyteDB on all nodes, as measured by the operating system. It displays the total disk space used by YugabyteDB across all nodes, as seen by the operating system.
This value includes everything inside the YugabyteDB data directories:- Table data files (SSTs)
- Write-Ahead Log (WAL) files
- Consensus and tablet metadata
- YugabyteDB log files, temp files, backups, and core dumps
-
Any other files stored in the data directory
Note: Data Disk Usage may be higher than the sum of table and WAL sizes because it counts all files in the directory including system, log, and backup files helping you plan capacity and monitor overall disk consumption.
2. Native YugabyteDB Web UIs
YugabyteDB also provides web UIs on each node for more detailed information.
Master UI Tablet Servers Page (http://<node_ip>:7000/tablet-servers)
Shows:
Num SST Files: Number of persistent SST data files present (files matching
*.sst.sblock.*).
Note: This value does not include the small index/metadata files (*.sst). Only the actual data block files are counted, as these hold the user table data. This is intentional in the code so the count is meaningful for fragmentation and compaction state, and avoids double-counting negligible metadata files.Total SST Files Size: Size of all SST files (matches disk size)
Uncompressed SST Files Size: Data size before compression
Master UI Tables Page (http://<node_ip>:7000/tables)
Shows per-table breakdown:
On-disk size: 59.08G ├── WAL Files: 8.02M ├── SST Files: 59.07G └── SST Files Uncompressed: 59.18G
For simplicity: The above table summary from Master/T-Server UI shows "Total: 59.08G", "SST Files: 59.07G", "SST Files Uncompressed: 59.18G", which use base 1024 units (GiB/MiB). This is a common reason for small differences when you compare storage numbers between the UIs.
T-Server UI Tables Page (http://<node_ip>:9000/tables)
Shows:
Consensus Metadata: Small files for Raft protocol
WAL Files: WAL file size for the table
SST Files: SST file size for the table
SST Files Uncompressed: Data size before compression
3. Storage Components Explained
SST Files
- Store table data on disk
- Metric:
rocksdb_current_version_sst_files_size - Includes both
.sstand.sst.sblock.*files
WAL Files
- Store changes before they’re written to disk
- Metric:
log_wal_size - Includes both active and closed WAL segment files
Consensus Metadata
- Keeps track of tablet leadership and Raft consensus
- Usually very small
4. Behaviors and Common Questions
MemTable (In-memory Table) Behavior
- Small tables may fit entirely in memory (default 128MB)
- SST size may show zero if not flushed to disk yet
- WAL size will still reflect the loaded data
Compression
- Compressed SST Size: Actual disk usage
- Uncompressed SST Size: Logical data size before compression
- YugabyteDB uses Snappy compression, which often shrinks data by 3-4 times
Replication Factor
- YugabyteDB stores data on multiple nodes (RF=3 is common)
- UI metrics include all replicas
- To estimate storage for a single replica, divide by RF
5. Checking Sizes on Disk (Command Line)
If you want to see the actual disk usage directly, you can use these commands:
SST Files
# Total SST file size (includes all .sst and .sst.sblock.* files)
stat -c "%s" /mnt/d0/yb-data/tserver/data/rocksdb/table-*/tablet-*/*.sst.* | \
awk '{total += $1} END {printf "Total: %d bytes | %.2f KiB | %.2f MiB | %.2f GB | %.2f GiB\n", total, total/1024, total/1024/1024, total/1e9, total/1024/1024/1024}'
Total: 63383972089 bytes | 61898410.24 KiB | 60447.67 MiB | 63.38 GB | 59.03 GiBThis matches "Total SST Files Size" in the Master UI.
WAL Files
# Total WAL file size
find /mnt/d0/yb-data/tserver/wals/table-00004000000030008000000000004018/tablet-*/ -name "wal-*" -exec du -b {} + | awk '{sum += $1} END {printf "TOTAL: %d bytes | %.2f KiB | %.2f MiB | %.2f GB | %.2f GiB\n", sum, sum/1024, sum/1024/1024, sum/1e9, sum/1024/1024/1024}'
TOTAL: 8407120 bytes | 8210.08 KiB | 8.02 MiB | 0.01 GB | 0.01 GiBDirectory Structure
/mnt/d0/yb-data/tserver/ ├── data/rocksdb/table-*/tablet-*/ # SST files ├── wals/tablet-*/ # WAL files ├── tablet-meta/ # Tablet metadata └── consensus-meta/ # Consensus metadata
6. Frequently Asked Questions (FAQ)
Q: Why are .sst.sblock.* files much larger than .sst files?
A: The .sst files contain indexes and metadata. The .sst.sblock.* files store the actual table data, usually compressed. Always count both for true size.
Q: Do the UI metrics match disk usage?
A: Yes, for SST files the metrics include everything you need. For WAL files, make sure you are using a recent YugabyteDB version.
Q: Why might a table show zero SST size?
A: Data may still be in memory (MemTable) and not yet flushed to disk. WAL files will show usage.
Q: How does replication factor affect my storage?
A: Metrics include all replicas. If RF=3, to estimate storage for a single replica, divide by 3.
Q: What compression does YugabyteDB use?
A: Snappy compression, which is fast and usually gives 3-4x reduction.
Q: Why does the table size in YBA UI look different from the size in Master/T-Server UI? For the same underlying data, the value shown in GB (YBA UI) will be slightly higher than the value shown in GiB (Master/T-Server UI).
A: YBA UI shows sizes using base 1000 units (MB/GB), where:
- 1 MB = 1,000,000 bytes
- 1 GB = 1,000,000,000 bytes
Master and T-Server UI show sizes using base 1024 units (MiB/GiB), where:
- 1 MiB = 1,048,576 bytes
- 1 GiB = 1,073,741,824 bytes
For example, if a table uses 63,500,000,000 bytes:
- YBA UI would show "63.5 GB"
- Master/T-Server UI would show "59.15 GiB"
This helps you compare values accurately across UIs!
Q: Can I use PostgreSQL’s table size commands in YugabyteDB?
A: You can use standard PostgreSQL size functions like pg_table_size and pg_size_pretty in YugabyteDB now! Recent releases have added distributed support so these functions return the true on-disk size for tables, matching what’s shown in the UI. Here is an example:
db_disk_demo_rf3=# SELECT pg_size_pretty( pg_table_size('public.demo1'));
pg_size_pretty
----------------
59 GB
(1 row)You can refer the How do I determine the size of a YSQL database?
Additional Links
Reference: SUPPORT-260
Comments
0 comments
Please sign in to leave a comment.