This topic describes the memory usage categories in a StarRocks backend (BE), its memory configuration, and how to view its memory usage.
Memory categories
To add or modify BE-related configurations in the E-MapReduce console, navigate to the Services page of your target cluster, open the Configure page for the STARROCKS service, and select the be.conf tab. For detailed instructions, see Manage configuration items.
|
Label |
Metric name |
Description |
BE configuration |
|
process |
starrocks_be_process_mem_bytes |
The actual memory used by the BE process, excluding reserved free memory. |
mem_limit |
|
query_pool |
starrocks_be_query_mem_bytes |
The total memory used by the BE query layer. |
None |
|
load |
starrocks_be_load_mem_bytes |
The total memory used for data loads. |
load_process_max_memory_limit_bytes, load_process_max_memory_limit_percent |
|
table_meta |
starrocks_be_tablet_meta_mem_bytes |
The total memory used for metadata. |
None |
|
compaction |
starrocks_be_compaction_mem_bytes |
The total memory used for compaction. |
compaction_max_memory_limit, compaction_max_memory_limit_percent |
|
column_pool |
starrocks_be_column_pool_mem_bytes |
Memory for the Column Pool, a column cache used to accelerate data reads from the storage layer. |
None |
|
page_cache |
starrocks_be_storage_page_cache_mem_bytes |
The page cache for the BE storage layer. |
disable_storage_page_cache, storage_page_cache_limit |
|
chunk_allocator |
starrocks_be_chunk_allocator_mem_bytes |
A per-CPU-core cache used to accelerate the allocation of small memory chunks. |
chunk_reserved_bytes_limit |
|
consistency |
starrocks_be_consistency_mem_bytes |
The memory used for periodic consistency checks. |
consistency_max_memory_limit_percent, consistency_max_memory_limit |
|
schema_change |
starrocks_be_schema_change_mem_bytes |
The total memory used by schema change tasks. |
memory_limitation_per_thread_for_schema_change |
|
clone |
starrocks_be_clone_mem_bytes |
The total memory used by tablet clone tasks. |
None |
|
update |
starrocks_be_update_mem_bytes |
The total memory used by the primary key model. |
None |
Memory configurations
BE configurations
|
Parameter |
Default |
Description |
|
mem_limit |
90% |
The memory limit for the BE process. By default, the hard limit is 90% of the host's memory, and the soft limit is 80%. You do not need to configure this parameter if the BE is deployed on a dedicated host. If it is co-located with other memory-intensive services, set this parameter according to your workload and resource plan. |
|
load_process_max_memory_limit_bytes |
107374182400 |
These parameters specify the absolute and percentage-based memory limits for data loads, respectively. The system uses the smaller value between If the memory used for a load reaches this limit, the system triggers disk flush and backpressure mechanisms. |
|
load_process_max_memory_limit_percent |
30 |
|
|
compaction_max_memory_limit |
-1 |
These parameters specify the absolute and percentage-based memory limits for compaction, respectively. The system uses the smaller value between If the memory used by a compaction task reaches this limit, the task fails. |
|
compaction_max_memory_limit_percent |
100 |
|
|
disable_storage_page_cache |
true |
Specifies whether to disable the page cache for the BE storage layer. This parameter is used with |
|
storage_page_cache_limit |
0 |
The memory limit for the page cache of the BE storage layer. |
|
chunk_reserved_bytes_limit |
2147483648 |
A cache that accelerates the allocation of small memory blocks. The default limit is 2,147,483,648 bytes (2 GB). Consider increasing this value if you have sufficient memory resources. |
|
consistency_max_memory_limit |
10G |
These parameters specify the absolute and percentage-based memory limits for consistency check tasks. The system uses the smaller value between If memory usage exceeds this limit, the task fails. |
|
consistency_max_memory_limit_percent |
20 |
|
|
memory_limitation_per_thread_for_schema_change |
2 |
The memory limit for a single schema change task. If memory usage exceeds this limit, the schema change task fails. |
|
tc_use_memory_min |
10737418240 |
The minimum memory that TCMalloc reserves. If the amount of idle memory is less than this value, StarRocks does not release it to the operating system. |
Session variables
|
Parameter |
Default |
Description |
|
exec_mem_limit |
2147483648 |
The memory limit for a single instance. |
|
load_mem_limit |
0 |
The memory limit for a single load task. A default value of |
View memory usage
You can analyze BE memory usage in the following two ways:
Method 1: Analyze via metrics interface
Metrics are updated every 10 seconds. Access the metrics with the following cURL command:
# The default webserver_port for a BE is 8040.
curl -XGET -s http://BE_IP:8040/metrics | grep "^starrocks_be_.*_mem_bytes\|^starrocks_be_tcmalloc_bytes_in_use"
For descriptions of these metrics, see Memory usage categories.
Method 2: Analyze via mem_tracker interface
You can access the interface using a web browser or a cURL command. This example uses a browser.
# The default webserver_port for a BE is 8040.
http://be_ip:8040/mem_tracker
The page displays the Memory Usage Detail table with columns: level, Label, Parent, Limit, Current Consumption, and Peak Consumption. The top-level entry is process, which contains sub-modules including query_pool, load, compaction, schema_change, column_pool, page_cache, chunk_allocator, clone, consistency, tablet_meta, and update. You can view the memory limit, current consumption, and peak consumption of each module.
The output includes the following parameters:
-
level: MemTracker has a tree structure. The first level represents the total memory used by the BE, and the second level represents the memory usage for each category.
-
Label: The label for the memory category. For descriptions of the labels, see Memory usage categories.
-
Parent: The label of the parent node.
-
Limit: The memory usage limit. A value of
noneindicates that there is no limit. -
Current consumption: The current memory consumption.
-
Peak consumption: The peak memory consumption.