<@U0A71G31CDV> Are there any benchmarks or workloa...
# questions-and-troubleshooting
j
@Rocky Are there any benchmarks or workload generators for testing StarRocks' data loading and compaction performance?
r
StarRocks provides several tools and standard benchmarks to test data loading and compaction performance. While there isn't a single tool exclusively for "compaction," compaction is typically tested by generating high-frequency or high-volume loading workloads using standard benchmark suites. 1. Benchmark Suites & Workload Generators StarRocks maintains an official benchmarking repository and supports several industry-standard datasets: * Official Benchmark Tool (GitHub): The starrocks-benchmark repository contains scripts for end-to-end testing, including: * SSB (Star Schema Benchmark): Used for testing flat-table and multi-table query performance. It includes
gen-ssb.sh
for data generation and
stream_load.sh
for high-speed ingestion testing. * TPC-H & TPC-DS: Scripts like
gen-tpch.sh
and
stream_load.sh
are provided to generate datasets (SF1 to SF1000+) and load them via Stream Load. * Built-in Data Generation (v3.3+): In recent versions, StarRocks has introduced native support for generating TPC-H and TPC-DS data directly within the system using External Catalogs (e.g.,
CREATE EXTERNAL CATALOG tpch PROPERTIES ("type" = "TPCH");
). This eliminates the need for external
dbgen
tools and local disk space. * DuckDB for TPC-DS: A common community practice is using DuckDB to generate TPC-DS data in Parquet format, which can then be loaded into StarRocks using the
INSERT INTO ... SELECT * FROM FILES()
syntax. 2. Testing Data Loading Performance To stress-test loading specifically, you can use the following methods: * Stream Load Transaction Interface: For testing high-concurrency and atomicity, use the Stream Load API. * StarRocks Flink/Kafka Connectors: These can be configured with high parallelism to simulate real-time streaming workloads, which is the most common way to stress the compaction engine. * DataX / SMT: For bulk migration testing from other databases. 3. Measuring & Stressing Compaction Compaction performance is typically evaluated by monitoring how well the background threads keep up with a heavy loading workload. * Compaction Score: This is the primary metric. You can monitor it using:
Copy code
sql
    SHOW PROC '/compactions';
    -- or for shared-data clusters
    SELECT * FROM information_schema.be_cloud_native_compactions;
If the Compaction Score exceeds 100, it indicates that compaction cannot keep up with the ingestion rate, and StarRocks will begin to throttle or reject new loads. * Manual Triggering: To test compaction performance in isolation (without loading), you can manually trigger it:
Copy code
sql
    ALTER TABLE <table_name> COMPACT;
* Metrics for Compaction: Use the StarRocks Grafana Dashboard to monitor
Cumulative Compaction
and
Base Compaction
rates, as well as the "Tablet Version Count." Summary of Recommended Workflow 1. Generate Workload: Use the
starrocks-benchmark
scripts to run a high-frequency Stream Load test. 2. Monitor Pressure: Use
SHOW PROC '/transactions/{db}/running'
to see if "Partition's compaction score is larger than 100.0" appears in the error message, signaling a bottleneck. 3. Tuning: If compaction is the bottleneck, increase
compact_threads
or
update_compaction_num_threads_per_disk
in the BE configuration (
be.conf
). References • administration/management/compaction.md • knowledge/admin_and_operation/shared_data_compaction.md • best_practices/primarykey_table.md • faq/shared_data_faq.md