为什么我的内核选择磁盘交换而不是 24G 非活动 RAM?

为什么我的内核选择磁盘交换而不是 24G 非活动 RAM?

以下输出meminfo来自 Proxmox 虚拟机管理程序。我今天注意到交换使用率为 90%。我登录到框并检查,似乎实际上有 24G 的非活动 RAM。几分钟后,我注意到交换使用率为 99%。 在此处输入图片描述

当有这么多非活动 RAM 可用时,为什么内核似乎倾向于磁盘交换(编辑:vmstat -s下面添加)?

# cat /proc/meminfo 
MemTotal:       131911836 kB
MemFree:        28128112 kB
MemAvailable:   51794976 kB
Buffers:          397876 kB
Cached:         23298352 kB
SwapCached:       509796 kB
Active:         73136224 kB
Inactive:       24833836 kB
Active(anon):   72432368 kB
Inactive(anon):  2030612 kB
Active(file):     703856 kB
Inactive(file): 22803224 kB
Unevictable:       20256 kB
Mlocked:           20260 kB
SwapTotal:       8388604 kB
SwapFree:          76592 kB
Dirty:               216 kB
Writeback:             0 kB
AnonPages:      73881564 kB
Mapped:           196212 kB
Shmem:            182376 kB
Slab:            3837772 kB
SReclaimable:    1413588 kB
SUnreclaim:      2424184 kB
KernelStack:       10608 kB
PageTables:       281164 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    74344520 kB
Committed_AS:   265844288 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:   2787328 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:     3584964 kB
DirectMap2M:    118982656 kB
DirectMap1G:    13631488 kB

vmstat -s

    131911840 K total memory
     85913712 K used memory
     80380944 K active memory
     24732132 K inactive memory
     20989356 K free memory
       405840 K buffer memory
     24602928 K swap cache
      8388604 K total swap
      8311256 K used swap
        77348 K free swap
     62711183 non-nice user cpu ticks
       711584 nice user cpu ticks
     19418784 system cpu ticks
   2202190185 idle cpu ticks
     12801599 IO-wait cpu ticks
            0 IRQ cpu ticks
       583222 softirq cpu ticks
            0 stolen cpu ticks
  11537252613 pages paged in
   3575771252 pages paged out
      1581238 pages swapped in
      3670384 pages swapped out
   3388189898 interrupts
   3739302263 CPU context switches
   1535799398 boot time
      3674458 forks

相关内容