Ubuntu 18.04.6 LTS
所有资源密集型任务都在 docker 中运行。
服务器内存约为 320gb。
问题:由于“无法分配内存”错误,系统非常不稳定,但有大量可用内存。
系统日志:
Jul 4 21:16:01 seo2 dockerd[6190]: ... error adding seccomp filter rule for syscall getcwd: cannot allocate memory ..
Jul 4 21:16:06 seo2 systemd-udevd[7711]: Failed to fork: Cannot allocate memory
Jul 4 21:16:06 seo2 networkd-dispatcher[5617]: OSError: [Errno 12] Cannot allocate memory
vmstat 于 21:16:05: (~100gb 可用内存 + ~30gb 可用内存)
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
19 0 4876 101314832 1515040 26962100 0 0 0 10544 99741 92965 38 9 53 0 0
/proc/meminfo 于 21:15:58:
MemTotal: 329878428 kB
MemFree: 102057892 kB
MemAvailable: 122571380 kB
Buffers: 1515036 kB
Cached: 15812592 kB
SwapCached: 60 kB
Active: 101504768 kB
Inactive: 10301332 kB
Active(anon): 96766348 kB
Inactive(anon): 4165196 kB
Active(file): 4738420 kB
Inactive(file): 6136136 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 4194300 kB
SwapFree: 4189424 kB
Dirty: 12660 kB
Writeback: 0 kB
AnonPages: 94459652 kB
Mapped: 7154140 kB
Shmem: 6879868 kB
Slab: 23807196 kB
SReclaimable: 11160972 kB
SUnreclaim: 12646224 kB
KernelStack: 384768 kB
PageTables: 1089868 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 334072728 kB
Committed_AS: 331331496 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 18432 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 154327872 kB
DirectMap2M: 177745920 kB
DirectMap1G: 5242880 kB
系统配置信息:
vm.swappiness = 0
vm.overcommit_memory = 2
vm.overcommit_ratio = 100
在我停止每个用户任务(我在docker中运行)之后,我仍然看到只有~200gb是免费的,而不是预期的~300gb。
但系统中没有任何消耗内存的运行进程。
服务器重启后 - 一切正常,并且有 300+gb 的内存可用。
当有大量可用内存时,系统应用程序怎么会失败并显示“无法分配内存”?
您能给我指明正确的方向吗?
谢谢。