【问题标题】:Linux SLUB: Unable to allocate memory on nodeLinux SLUB:无法在节点上分配内存
【发布时间】:2019-05-05 10:41:53
【问题描述】:

我们经常收到/var/log/messages下面的消息

kernel: SLUB: Unable to allocate memory on node -1 (gfp=0x8020)

在某些情况下后跟分配表

kernel:    cache: sigqueue(12019:454c4ebd186d964699132181ad7367c669700f7d8991c47d4bc053ed101675bc), object size: 160, buffer size: 160, default order: 0, min order: 0
kernel:    node 0: slabs: 57, objs: 23313, free: 0
kernel:    node 1: slabs: 35, objs: 14315, free: 0

好的,free 是 0,但是如何调整呢?

以下是设置信息


OS - Centos7.3
Kernel - 3.10.0-327.36.3.el7.x86_64
Docker - 1.12.6
Kubernetes - 1.5.5

我们有由 kurbernetes 提供支持的私有云,有 10 个节点;直到上个月它都运行良好,现在我们在每个节点上都非常频繁地收到这些警报,最近几天 Pod/容器也增加了。

每个节点上都有足够的memorycpu 可用。

对这些警报进行任何微调都会非常有帮助。

附加信息: sysctl.conf 选项

net.ipv4.tcp_timestamps = 0 
net.ipv4.tcp_max_syn_backlog = 4096 
net.core.somaxconn = 1024 
net.ipv4.tcp_syncookies = 1 
net.core.rmem_max = 16777216 
net.core.wmem_max = 16777216 
net.core.rmem_default = 65535 
net.core.wmem_default = 65535 
net.ipv4.tcp_rmem = 4096 87380 16777216 
net.ipv4.tcp_wmem = 4096 65536 16777216 
net.ipv4.ip_local_port_range = 1024 65535 
vm.max_map_count = 262144 
vm.swappiness=10 
vm.vfs_cache_pressure=100

【问题讨论】:

  • #sysctl.conf 选项 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_max_syn_backlog = 4096 net.core.somaxconn = 1024 net.ipv4.tcp_syncookies = 1 net.core.rmem_max = 16777216 网络。 core.wmem_max = 16777216 net.core.rmem_default = 65535 net.core.wmem_default = 65535 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.ip_local_port_range = 1024 65535 vm.max_map_count = 262144 vm.swappiness=10 vm.vfs_cache_pressure=100
  • 似乎 SLUB 分配器 无法分配任何交换空间。您检查过交换分区上的坏块(mkswap -c)吗?
  • 您能在SLUB: Unable to allocate 消息之后添加额外的行吗?它们可能在 dmesg 中,但未打印到控制台。关联的行将有两个空格的缩进。

标签: linux linux-kernel centos kubernetes


【解决方案1】:

【讨论】:

    【解决方案2】:

    问题似乎与kernel 有关,首先检查free -mmkswap -c 是否正确分配了交换内存,如果未正确分配交换内存,请执行此操作。如果swap没问题,那么你可能需要更新内核。

    【讨论】:

      猜你喜欢
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多