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

115. OOM(内存不足),高内存消耗,基本故障排除步骤

Situation 地理位置

Memory consumption on the nodes is too high, or OOM kill is happening frequently.
节点内存消耗过高,或者 OOM 杀机频繁发生。

At the Kubernetes level
在 Kubernetes 层面

Start with kubectl top as it should tell what is consuming memory at the point in time:
先从 kubectl top 开始,因为它应该能显示当前占用内存的因素:

<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code># check which pods are consuming most memory kubectl top pods # check which nodes are affected kubectl top nodes</code></span></span></span>

A few questions that can help are:
有几个问题可以帮助你:

  • Which pods are consuming the most resources?
    哪些舱体消耗最多资源?
  • Is it on a specific node, or across all nodes?
    是在某个特定节点,还是跨所有节点?
  • Describing the node, is it over-provisioned?
    描述节点,是不是过度配置?

This might give opportunities for better capacity planning for your applications.
这可能为你的应用提供更好的容量规划机会。

At the node level
在节点层面

Check the messages (or with dmesg -T) for the OOM Kill message:
请查看消息(或用 dmesg -T)来确认 OOM 杀死消息:

  • If invoked by cgroup, it means that limits are being respected. Adjust them as needed.
    如果被 cgroup 调用,表示限制被尊重。根据需要调整它们。
  • If invoked by the kernel, it means that the node is running out of memory and OOM is reclaiming it
    如果被内核调用,意味着节点内存快用完了,OOM 正在回收

Check the kubelet logs for OOM kills.
查看库贝莱特的日志,看看 OOM 击杀数。

Resolution 结局

Rancher Project Resource Quotas:
牧场主项目资源配额:

Rancher allows for resource management at the Project level. Please review the documentation on how to set limits at the Project and Namespace levels.
Rancher 允许在项目层面进行资源管理。请查阅关于如何在项目和命名空间层面设置限制的文档 。

For non-Rancher components:
对于非牧场主组件:

Adjust the requests and limits as per the Kubernetes documentation. It can be done at many levels. At spec.container, or even on the values.yaml. Here is an example from Rancher Monitoring:
根据 Kubernetes 文档调整请求和限制。它可以在多个层面进行。在 spec.container,甚至在 values.yaml 上。这里有一个来自牧场主监测的例子:

<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code>resources: limits: memory: 500Mi cpu: 1000m requests: memory: 100Mi cpu: 100m</code></span></span></span>

If you are experiencing issues with Rancher-shipped components, open a case with Rancher Support. Please collect all the data below when contacting SUSE Rancher support.
如果您在使用 Rancher 出货的组件时遇到问题,请向 Rancher 支持部门提交申诉。联系 SUSE 牧场支持时,请收集以下所有数据。

  • kubectl top pods
    Kubectl 顶层烟囊
  • kubectl top nodes Kubectl 顶端节点
  • Grafana Graphs of the affected services, or graphs from any monitoring in place
    受影响服务的 Grafana 图,或任何监控的图表
  • The log bundle: https://www.suse.com/support/kb/doc/?id=000020191
    对数丛:https://www.suse.com/support/kb/doc/?id=000020191
  • The resource count of Rancher: https://www.suse.com/support/kb/doc/?id=000021310
    牧场主的资源数量:https://www.suse.com/support/kb/doc/?id=000021310
  • You might be asked by support to also collect profiles of Rancher or Fleet: https://www.suse.com/support/kb/doc/?id=000021615
    客服可能会要求你收集 Rancher 或 Fleet: https://www.suse.com/support/kb/doc/?id=000021615 的资料
Cause 病因

OOM kills or high memory usage might be caused by lack of resources, configuration issues or application failures.
OOM 杀机或高内存使用可能由资源不足、配置问题或应用失败引起。

访问Rancher-K8S解决方案博主,企业合作伙伴 :
https://blog.csdn.net/lidw2009

http://www.jsqmd.com/news/577430/

相关文章:

  • 5大核心功能解析:GHelper轻量替代方案如何优化华硕笔记本性能
  • Mac上IntelliJ IDEA 2024.1.1启动报错?手把手教你删除-javaagent修复(附详细路径)
  • 知网AIGC检测算法2026年更新了什么这样降AI才有效
  • 收藏备用!小白程序员必看:从基础到进阶,彻底吃透Prompt与提示工程
  • Debian 12.0 + Nginx + Let’s Encrypt:5分钟搞定HTTPS配置(含自动续期)
  • 给技术人的另类书单:从《纳瓦尔宝典》的‘代码杠杆’谈到工程师的财富与幸福实践
  • 全球与中国边缘保护系统市场现状洞察与未来走向研判
  • 46397
  • 离线应急方案:OpenClaw断开网络时调用本地Qwen3-4B继续工作
  • 【电路】从零开始掌握大学电路核心定律与分析方法
  • 茉莉花插件:5分钟快速上手Zotero中文文献智能管理终极指南
  • 跨平台性能监控实战:从本地到服务器的全面指南
  • RTX 4090专属优化:造相-Z-Image防爆显存+BF16高精度实战解析
  • 【嵌入式实战】环形缓冲区在数据流处理中的核心应用与避坑指南
  • 保姆级教程:在Windows 10/11上搞定Carsim 2019.0安装与破解(含防火墙关闭和许可文件配置)
  • SEO优化教程网推广技巧有哪些
  • Windows 11 24H2 LTSC 微软商店部署指南:从原理到实践
  • 从零构建STM32F429智能控制终端:基于TouchGFX GUI与FreeRTOS的多任务IO调度实践
  • 告别编译报错!Ubuntu 22.04 LTS下x264库的保姆级安装指南(含configure参数详解)
  • FPGA项目实战:如何用PWM波同时搞定电机和舵机?Ego1避障小车中的双PWM控制核心解析
  • Qwen3-14B大模型落地实践:中小企业私有AI助手部署完整流程
  • 告别Permission denied!5分钟搞定GitHub多账号SSH密钥配置(含可视化操作指南)
  • 安卓逆向实战:Frida检测绕过与反制策略全解析
  • macOS Finder视频预览终极指南:QLVideo让专业视频管理触手可及
  • OFA 视觉问答(VQA)模型部署教学(避坑完整版)
  • 2026年名酒回收/洋酒回收/茅台酒/五粮液/陈年老酒高价上门现金回收服务专业推荐榜:诚信高效,价值兑现之选 - 品牌企业推荐师(官方)
  • 3大核心能力让你轻松掌控ZTE ONU设备管理
  • 2026年3月,为你推荐市场口碑好的便携式咖啡机维修中心,市场服务好的咖啡机维修产品有哪些优选实力品牌 - 品牌推荐师
  • 别再只盯着Xilinx官方板卡了:用UD PCIe-403信号处理模块搭建高性价比算法验证平台(含FPGA选型指南)
  • 2026年 水平垂直燃烧试验仪厂家推荐榜单:UL94阻燃箱/V0V1V2等级测试仪/电子电工着火危险评定设备精选 - 品牌企业推荐师(官方)