Terminology
Load Job: A continuous data load process, such as a Routine Load Job or Pipe Job. Load Task: A one-time data load process, usually corresponding to a single load transaction. Examples include Broker Load, Stream Load, Spark Load, and INSERT INTO. Routine Load jobs and Pipe jobs continuously generate tasks to perform data ingestion.Observe load jobs
There are two ways to observe load jobs:- Using SQL statements SHOW ROUTINE LOAD and SHOW PIPES.
- Using system views information_schema.routine_load_jobs and information_schema.pipes.
Observe load tasks
Load tasks can also be monitored in two ways:- Using SQL statements SHOW LOAD and SHOW ROUTINE LOAD TASK.
- Using system views information_schema.loads and
_statistics_.loads_history.
SQL statements
The SHOW statements display both ongoing and recently completed load tasks for the current database, providing a quick overview of task status. The information retrieved is a subset of the_statistics_.loads_history system view.
SHOW LOAD statements return information of Broker Load, Insert Into, and Spark Load tasks, and SHOW ROUTINE LOAD TASK statements return Routine Load task information.
System views
information_schema.loads
The information_schema.loads system view stores information about recent load tasks, including active and recently completed ones. The database periodically synchronizes the data to the_statistics_.loads_history system table for persistent storage.
information_schema.loads provides the following fields:
RUNTIME_DETAILS
- Universal metrics:
- Specific metrics for Broker Load, INSERT INTO, and Spark Load:
- Specific metrics for Routine Load:
- Specific metrics for Stream Load:
PROPERTIES
- Specific properties for Broker Load, INSERT INTO, and Spark Load:
- Specific properties for Routine Load:
_statistics_.loads_history
The _statistics_.loads_history system view stores load records for the last 30 days by default. DBAs can adjust the retention period by modifying the FE configuration item loads_history_retained_days. Do not modify the partition_live_number property of the table directly, because the database resets it to the value of loads_history_retained_days. _statistics_.loads_history has the consistent schema with information_schema.loads.
Identify loading performance issues with Load Profiles
A Load Profile records execution details of all worker nodes involved in a data load. It helps you quickly pinpoint performance bottlenecks in the cluster.Enable Load Profiles
The database provides multiple methods to enable Load Profiles, depending on the type of load:For Broker Load and INSERT INTO
Enable Load Profiles for Broker Load and INSERT INTO at session level:big_query_profile_threshold is 30s from v3.3.12, v3.4.2, and v3.5.0 onwards. In earlier versions, the default value is 0, which disables automatic profiling of long-running jobs.
The database also supports Runtime Profiles, which periodically (every 30 seconds) report execution metrics of long-running load jobs. You can customize the report interval by:
runtime_profile_report_interval specifies only the minimum report interval for load tasks. The actual report interval is dynamically adjusted and may exceed this value.
For Stream Load and Routine Load
Enable Load Profiles for Stream Load and Routine Load at table level:load_profile_collect_interval_second. This setting only applies to Load Profiles enabled via table properties. The default value is 0.
stream_load_profile_collect_threshold_second. The default value is 0.
Analyze Load Profiles
The structure of Load Profiles is identical to that of Query Profiles. For detailed instructions, see Query Tuning Recipes. You can analyze Load Profiles by executing ANALYZE PROFILE. For detailed instructions, see Analyze text-based Profiles. Profiles provide detailed operator metrics. Key components include theOlapTableSink operator and the LoadChannel operator.
PreSplit node
When the database attempts to pre-split a range-distributed target for INSERT, Broker Load, or an incremental materialized view refresh, the top-level Load Profile contains aPreSplit node. The node is omitted when the load does not attempt pre-splitting.
The node contains the following time metrics:
The node also contains the following counters:
The information strings identify the execution path:
OlapTableSink operator
Tip
- The significant variance between the maximum and minimum values of
PushChunkNuminOLAP_TABLE_SINKindicates data skew in the upstream operator, which may cause write performance bottlenecks. RpcClientSideTimeequals the sum ofRpcServerSideTime, Network transmission time, and RPC framework processing time. If the difference betweenRpcClientSideTimeandRpcServerSideTimeis significant, consider to enable data compression to reduce transmission time.- If
RpcServerSideTimeaccounts for a significant portion of the time spent, further analysis can be conducted usingLoadChannelProfile.
LoadChannel operator
Tip
If
WaitFlushTime takes an extended period, it may indicate insufficient resources for the flush thread. Consider adjusting the BE configuration flush_thread_num_per_store.
Best practices
Diagnose Broker Load performance bottleneck
-
Load data using Broker Load:
-
Use SHOW PROFILELIST to retrieve the list of runtime profiles.
-
Use ANALYZE PROFILE to view the Runtime Profile.
FILE_SCAN section took nearly 29 seconds, accounting for approximately 90% of the total 32-second duration. This indicates that reading data from object storage is currently the bottleneck in the loading process.
Diagnose Stream Load Performance
-
Enable Load Profile for the target table.
-
Use SHOW PROFILELIST to retrieve the list of profiles.
-
Use ANALYZE PROFILE to view the Profile.
Appendix
Useful SQL for Operations
Note This section only applies to shared-nothing clusters.query the throughput per minute
Query RowsetNum and SegmentNum of a table
- High RowsetNum (>100) indicates too frequent loads. You may consider to reduce frequency or increase Compaction threads.
- High SegmentNum (>100) indicates excessive segments per load. You may consider increase Compaction threads or adopt the random distribution strategy for the table.
Check data skew
Data skew across nodes
Data skew across tablets
Common monitoring metrics for loading
BE Load
These metrics are available under the BE Load category in Grafana. If you cannot find this category, verify that you are using the latest Grafana dashboard template.ThreadPool
These metrics help analyze the status of thread pools — for example, whether tasks are being backlogged, or how long they spend pending. Currently, there are four monitored thread pools:async_delta_writermemtable_flushsegment_replicate_syncsegment_flush
Note
- A reliable indicator for backlog is whether pending duration keeps increasing. workers util and queue count are necessary but not sufficient indicators.
- If a backlog occurs, use rate and execute duration to determine whether it is due to increased load or slower processing.
- workers util helps assess how busy the pool is, which can guide tuning efforts.
LoadChannel::add_chunks
These metrics help analyze the behavior ofLoadChannel::add_chunks after receiving a BRPC tablet_writer_add_chunks request.
Note
- The latency metric equals the sum of
wait_memtable,wait_writer, andwait_replica. - A high waiting ratio indicates downstream bottlenecks, which should be further analyzed.
Async Delta Writer
These metrics help analyze the behavior of the async delta writer.
Note
- The total time per task (from the upstream perspective) equals pending plus execute.
- execute further includes wait_memtable plus wait_replica.
- A high pending time may indicate that execute is slow or the thread pool is undersized.
- If wait occupies a large portion of execute, downstream stages are the bottleneck; otherwise, the bottleneck is likely within the writer’s logic itself.
MemTable Flush
These metrics analyze MemTable flush performance.
Note
- By comparing rate and size, you can determine whether the workload is changing or if massive imports are occurring — for example, a small rate but large size indicates a massive import.
- The compression ratio can be estimated using
memory-size / disk-size. - You can also assess if I/O is the bottleneck by checking the proportion of io time in execute.
Segment Replicate Sync
Segment Flush
These metrics analyze segment flush performance.
Note
- By comparing rate and size, you can determine whether the workload is changing or if large imports are occurring — for example, a small rate but large size indicates a massive import.
- You can also assess if I/O is the bottleneck by checking the proportion of io time in execute.