Used: 438105027512, Limit: 438103947386. Mem usage has exceed the limit of single query, You can change the limit by set session variable exec_mem_limit目前我设置比较这个限制的值大,还是报错超出限制,

ERROR 1064 (HY000): Memory of Query437f0104-26bb-11ed-adf2-fa163e88b465 exceed limit. Pipeline Backend: 10.0.0.85, fragment: 437f0104-26bb-11ed-adf2-fa163e88b793 Used: 438104109407, Limit: 438103947386. Mem usage has exceed the limit of single query, You can change the limit by set session variable exec_mem_limit.

这个参数应该可以多个SQL同时执行,他只是使用临时变量来执行这个SQL。
根据您BE服务器实际的内存来设定exec_mem_limit

这个语句指定这个session_variable 表就可以了吧
select /*+ SET_VAR(exec_mem_limit = 515396075520,query_timeout=10000000,batch_size=4096,parallel_fragment_exec_instance_num=32) */ * from session_variables;

select /*+ SET_VAR(exec_mem_limit = 515396075520,query_timeout=10000000,batch_size=4096,parallel_fragment_exec_instance_num=32) */ * from 这里后面接上您的SQL,不是session_variables;

select /+ SET_VAR(exec_mem_limit = 515396075520,query_timeout=10000000,batch_size=4096,parallel_fragment_exec_instance_num=32) / * from
WITH frequent_ss_items AS (SELECT substr(i_item_desc, 1, 30) itemdesc, i_item_sk item_sk, d_date solddate, count(
) cnt FROM store_sales, date_dim, item WHERE ss_sold_date_sk = d_date_sk AND ss_item_sk = i_item_sk AND d_year IN (2000, 1999 + 1, 1999 + 2, 1999 + 3) GROUP BY substr(i_item_desc, 1, 30), i_item_sk, d_date HAVING count(
) > 4), max_store_sales AS (SELECT max(csales) tpcds_cmax FROM (SELECT c_customer_sk, sum(ss_quantity * ss_sales_price) csales FROM store_sales, customer, date_dim WHERE ss_customer_sk = c_customer_sk AND ss_sold_date_sk = d_date_sk AND d_year IN (1999, 1999 + 1, 1999 + 2, 1999 + 3) GROUP BY c_customer_sk) x), best_ss_customer AS (SELECT c_customer_sk, sum(ss_quantity * ss_sales_price) ssales FROM store_sales, customer WHERE ss_customer_sk = c_customer_sk GROUP BY c_customer_sk HAVING sum(ss_quantity * ss_sales_price) > (50 / 100.0) * (SELECT * FROM max_store_sales)) SELECT sum(sales) FROM ((SELECT cs_quantity * cs_list_price sales FROM catalog_sales, date_dim WHERE d_year = 1999 AND d_moy = 2 AND cs_sold_date_sk = d_date_sk AND cs_item_sk IN (SELECT item_sk FROM frequent_ss_items) AND cs_bill_customer_sk IN (SELECT c_customer_sk FROM best_ss_customer)) UNION ALL (SELECT ws_quantity * ws_list_price sales FROM web_sales, date_dim WHERE d_year = 1999 AND d_moy = 2 AND ws_sold_date_sk = d_date_sk AND ws_item_sk IN (SELECT item_sk FROM frequent_ss_items) AND ws_bill_customer_sk IN (SELECT c_customer_sk FROM best_ss_customer))) y LIMIT 100;

是这样吗,还是后面是表

select xxx from table where xxx;
select与查询字段之间把 SET_VAR 加上


exec_mem_limit 和 parallel_fragment_exec_instance_num 是可以通过 set global xxx=xxx;全局设置的。

我已经这个设置过了
set global exec_mem_limit = 515396075520
set global parallel_fragment_exec_instance_num = 32;
set global enable_cbo = true;
set globale batch_size=4096

还是报相同的错误,我截图帮忙看一下

echo 1 | sudo tee /proc/sys/vm/overcommit_memory
echo 'madvise' | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo 'madvise' | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
echo 0 | sudo tee /proc/sys/vm/swappiness
ulimit -SHnu 65535


select * from session_variables;
select * from global_variables;

如果是压测,您的服务器是64核,parallel_fragment_exec_instance_num 可以考虑设置大点

嗯嗯好的

还是出现这个情况 ERROR 1064 (HY000): Memory of Query9938f868-26bf-11ed-adf2-fa163e88b465 exceed limit. Pipeline Backend: 10.0.0.85, fragment: 9938f868-26bf-11ed-adf2-fa163e88b777 Used: 438104779592, Limit: 438103947386. Mem usage has exceed the limit of single query, You can change the limit by set session variable exec_mem_limit.

这些都设置过了,包括io参数都调整了

请提供一下架构和服务器配置

目前是10台机器 每台机器64核,512g 目前是部署3台fe 节点 10台be 节点
这是be 配置
#doris_scanner_row_num = 102400
#doris_max_scan_key_num= 102400
#doris_scanner_queue_size = 102400
#doris_scanner_thread_pool_queue_size = 1024000

#BRPC 的 bthreads 线程数量,-1 表示和 CPU 核数一样
brpc_num_threads = -1
#每个 CPU core 启动的线程数
num_threads_per_core = 200
#BE 之间 rpc 通信是否压缩 RowBatch,用于查询层之间的数据传输
compress_rowbatches = true
#存储引擎并发扫描磁盘的线程数,统一管理在线程池中
doris_scanner_thread_pool_thread_num = 180
#开启pagecache
disable_storage_page_cache = false
#pagecache
storage_page_cache_limit = 50G
#的最大并发, -1 代表没有限制
max_compaction_concurrency = -1
#文件句柄缓存的容量
#file_descriptor_cache_capacity = 65536

最大查询线程数

#394292846428
starrocks_be_query_mem_bytes = 500G
#单个查询上限,该配置为0 exec_mem_limit 此配置生效
query_mem_limit = 500G

BE 进程实际使用的内存(不包含预留的空闲内存)

starrocks_be_process_mem_bytes = 500G
#max_compaction_concurrency=0
#单个 block 最大的字节数,100MB
max_unpacked_row_block_size = 209715200
#磁盘错误达到一定比例,BE 退出
max_percentage_of_error_disk = 10
tc_use_memory_min = 10737418240
write_buffer_size = 104857600
mem_limit = 100%

之前是3台fe ,7台be 后来把fe的节点也扩容成be

我现在调整exec_mem_limit 这个参数,还是抛出ERROR 1064 (HY000): Memory of Queryd6fcf942-273b-11ed-8cc5-fa163e88b465 exceed limit. Pipeline Backend: 10.0.0.85, fragment: d6fcf942-273b-11ed-8cc5-fa163e88b650 Used: 438104174304, Limit: 438103947386. Mem usage has exceed the limit of single query, You can change the limit by set session variable exec_mem_limit.,我看 10.0.0.85 这台机器上还剩下230G内存,现在有点不是很理解,本机上还剩下挺多内存,并且调整参数调整到了515396075520,他这个算法是怎么算的呢