当前位置: 首页 > article >正文

impala set设置MEM_LIMIT

The MEM_LIMIT query option defines the maximum amount of memory a query can allocate on each node. The total memory that can be used by a query is the MEM_LIMIT times the number of nodes.

There are two levels of memory limit for Impala. The ‑‑mem_limit startup option sets an overall limit for the impalad process (which handles multiple queries concurrently). That process memory limit can be expressed either as a percentage of RAM available to the process such as ‑‑mem_limit=70% or as a fixed amount of memory, such as 100gb. The memory available to the process is based on the host's physical memory and, since Impala 3.2, memory limits from Linux Control Groups. E.g. if an impalad process is running in a Docker container on a host with 100GB of memory, the memory available is 100GB or the Docker container's memory limit, whichever is less.

The MEM_LIMIT query option, which you set through impala-shell or the SET statement in a JDBC or ODBC application, applies to each individual query. The MEM_LIMIT query option is usually expressed as a fixed size such as 10gb, and must always be less than the impalad memory limit.

If query processing approaches the specified memory limit on any node, either the per-query limit or the impalad limit, then the SQL operations will start to reduce their memory consumption, for example by writing the temporary data to disk (known as spilling to disk). The result is a query that completes successfully, rather than failing with an out-of-memory error. The tradeoff is decreased performance due to the extra disk I/O to write the temporary data and read it back in. The slowdown could potentially be significant. Thus, while this feature improves reliability, you should optimize your queries, system parameters, and hardware configuration to make this spilling a rare occurrence.

Type: numeric

Units: A numeric argument represents memory size in bytes; you can also use a suffix of m or mb for megabytes, or more commonly g or gb for gigabytes. If you specify a value with unrecognized formats, subsequent queries fail with an error.

Default: 0 (unlimited)

Usage notes:

The MEM_LIMIT setting is primarily useful for production workloads. Impala's Admission Controller can be configured to automatically assign memory limits to queries and limit memory consumption of resource pools. See Concurrent Queries and Admission Control and Memory Limits and Admission Control for more information on configuring the resource usage through admission control.

Use the output of the SUMMARY command in impala-shell to get a report of memory used for each phase of your most heavyweight queries on each node, and then set a MEM_LIMIT somewhat higher than that. See Using the SUMMARY Report for Performance Tuning for usage information about the SUMMARY command.

直接实战

我们查个sql

select count(1)
from odserpjdata_kd.gl_code_combinations  gcc ,
odserpjdata_kd.gl_balances  gb 
where gb.code_combination_id =gcc.code_combination_id 

 set mem_limit=74mb;

select count(1)
from odserpjdata_kd.gl_code_combinations  gcc ,
odserpjdata_kd.gl_balances  gb 
where gb.code_combination_id =gcc.code_combination_id 

 峰值内存由683.4降低为419,看的出来还是有点效果的。但是可以看到查询的时间也多了一点。 Impala内存不够、查询超出内存的原因以及优化方式_impala内存参数设置_Kevin_鹿的博客-CSDN博客


http://www.kler.cn/a/6653.html

相关文章:

  • 【机器学习】机器学习的基本分类-强化学习(Reinforcement Learning, RL)
  • 面试题整理9----谈谈对k8s的理解2
  • Linux crontab 使用教程
  • STM32MP1linux根文件系统目录作用
  • springboot443旅游管理系统(论文+源码)_kaic
  • OpenCV(python)从入门到精通——运算操作
  • 【Java】【并发编程】Synchronized
  • 警惕,3月20日WOS目录更新,50本SCI/SSCI被剔除,这个出版社多达18本
  • PX4从放弃到精通(二十七):固定翼姿态控制
  • Java:5大最佳Java库
  • 跳表skiplist
  • Android12 Launcher3客制化:添加非抽屉模式(可动态切换)、图标自动补位功能
  • 使用C#中的Aspose Word 在对Word文档中的书签详细总结(包括增删改查等操作)
  • python实战应用讲解-【numpy专题篇】numpy常见函数使用示例(十)(附python示例代码)
  • 2023年美赛春季赛 赛题浅析
  • 在Linux系统下使用GDB调试C++程序【命令行调试与vscode编译器调试】
  • django前后端不分离——图片验证码,基于Bootstrap3的自定义分页器,Bootstrap模态框无法使用解决方案
  • list模拟实现
  • 00后面试华为软件测试工程师,竭尽全力拿到15K。。。。。
  • 解析安装程序使用指南
  • 华为OD机试-最优资源分配-2022Q4 A卷-Py/Java/JS
  • 美团暑期实习
  • 【python设计模式】10、组合模式
  • 从大厂到创业公司,管理上需要怎样转变?
  • ChatGPT背后的技术和多模态异构数据处理的未来展望——我与一位资深工程师的走心探讨
  • 获取元素通常使用的两种方式