当前位置: 首页 > 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.cnnetsun.cn/news/1655488.html

相关文章:

  • 无组织废气治理进入AI报告审核阶段:IACheck助力质控水平全面提升
  • 3大核心功能突破JSON可视化难题:vue-json-pretty革新前端数据展示体验
  • 跨平台性能监控实战:从本地到服务器的全面指南
  • 从零构建STM32F429智能控制终端:基于TouchGFX GUI与FreeRTOS的多任务IO调度实践
  • 比话降AI和嘎嘎降AI哪个好知网用户怎么选
  • 革新性AI角色交互平台:SillyTavern的突破性技术与应用场景
  • QMCDecode打破QQ音乐格式垄断:实现音乐文件自由掌控的开源解决方案
  • Windows 11终极优化指南:使用Win11Debloat快速清理系统臃肿
  • 科研自用umat:晶体塑性耦合扩展有限元实现裂纹扩展
  • ComfyUI-WanVideoWrapper全流程实战指南:从入门到专业视频生成
  • 别再只盯着Xilinx官方板卡了:用UD PCIe-403信号处理模块搭建高性价比算法验证平台(含FPGA选型指南)
  • 拯救录音质量!用MATLAB实现手机录音降噪的3种方法对比(含Butterworth/FFT/小波变换)
  • 五大赛道齐亮相!第四届世界科学智能大赛启动报名,首设人文科学赛道
  • Phi-3-mini-4k-instruct-ggufGPU算力优化:CUDA Graphs加速下P99延迟降低42%实测
  • Postman团队版协作踩坑实录:我们是如何被‘英文界面’拖慢项目进度的
  • Godot PCK文件解包终极指南:3分钟掌握游戏资源提取
  • 当滑块遇上润滑油:用MATLAB玩转流体润滑仿真
  • 百度网盘提取码智能查询工具:3秒破解资源访问密码的终极方案
  • I2Cdevlib-MPU9150九轴传感器驱动深度解析
  • 告别FSMC,用STC32G的LCM模块驱动8080屏:实测ILI9341驱动代码与官方库函数配置详解
  • 怕 AI 短剧平台抽成?自研 AI 短剧创作系统贴牌合作,全部收益自留
  • 3种方案打造专属个人视频平台:H-Player V2完全部署指南
  • Translumo:打破语言壁垒实现无缝跨屏翻译的效率工具
  • SpringBoot项目(苍穹外卖)微信支付模拟实战:不申请商户号,如何完整跑通支付流程?
  • React19 + Tailwindcss V4 实战:手把手教你打造一个高颜值标签输入与随机选择器
  • AI for Science:如何用人工智能“炼”出新合金?—— 概念、原理、应用与未来全解析
  • I2C上拉电阻选型避坑指南:从1kΩ到10kΩ的实战经验分享
  • 从抢新闻的视角发布时间排名晚一秒就是输
  • AI赋能设计:让快马平台智能补全与优化你的openclaw系统架构图
  • 卡尔曼滤波估算车辆质量——Matlab Simulink仿真模型探索