CentOS 99%内存使用率

CentOS 99%内存使用率

过去一周,我的 CentOS VPS 内存使用率达到 99%。

[root@server ~]# free -m
         total       used       free     shared    buffers     cached
Mem:          2048       2032         15          2          0         17
-/+ buffers/cache:       2014         33
Swap:         2048         45       2002

重新启动服务器后,内存将在 2 小时内缓慢增加,然后服务器的内存使用率再次达到 99%。

[root@server ~]# top
top - 13:34:10 up 2 days, 17:30,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  49 total,   1 running,  47 sleeping,   1 stopped,   0 zombie
Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,   349744k used,  1747408k free,        0k buffers
Swap:  2097152k total,        0k used,  2097152k free,    52452k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0 19236 1456 1216 S  0.0  0.1   0:00.06 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd/221
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper/221
  133 root      16  -4 10644  660  396 S  0.0  0.0   0:00.00 udevd
  493 root      20   0  179m 1460 1056 S  0.0  0.1   0:00.02 rsyslogd
  540 root      20   0 66220 1176  464 S  0.0  0.1   0:00.01 sshd
  574 root      20   0 11308 1464 1208 S  0.0  0.1   0:00.00 mysqld_safe
  676 mysql     20   0  432m  20m 5612 S  0.0  1.0   0:00.31 mysqld
  702 root      20   0 19268  756  500 S  0.0  0.0   0:00.00 dovecot
  710 dovecot   20   0 12988 1068  872 S  0.0  0.1   0:00.00 anvil
  711 root      20   0 13116 1188  872 S  0.0  0.1   0:00.00 log
  784 root      20   0 80860 3388 2472 S  0.0  0.2   0:00.01 master
  792 postfix   20   0 80940 3296 2424 S  0.0  0.2   0:00.00 pickup

任何帮助都将非常有帮助,谢谢。

Shift-M 顶部

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
676 mysql     20   0  432m  20m 5612 S  0.0  1.0   0:00.70 mysqld
795 root      20   0  127m  16m 3740 S  0.0  0.8   0:00.11 cwpsrvd
812 root      20   0  127m  13m  764 S  0.0  0.7   0:00.00 cwpsrvd
811 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
813 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
814 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
815 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
851 root      20   0 99972 4332 3348 S  0.0  0.2   0:00.06 sshd
1226 postfix   20   0 81132 3956 2860 S  0.0  0.2   0:00.00 tlsmgr
3744 root      20   0 98632 3816 2880 S  0.0  0.2   0:00.00 sshd
784 root      20   0 80860 3388 2472 S  0.0  0.2   0:00.01 master
793 postfix   20   0 81008 3356 2472 S  0.0  0.2   0:00.00 qmgr
792 postfix   20   0 80940 3296 2424 S  0.0  0.2   0:00.00 pickup
3805 root      20   0 67564 3264 2504 S  0.0  0.2   0:00.00 sshd
803 root      20   0 56612 2952 1652 S  0.0  0.1   0:00.08 httpd
848 nobody    20   0 56744 2884 1368 S  0.0  0.1   0:00.00 httpd
849 nobody    20   0 56744 2884 1368 S  0.0  0.1   0:00.00 httpd

Shift-M Top(99% 内存使用率)

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
676 mysql     20   0  432m 4556 3028 S  0.3  0.2   0:04.20 mysqld
19989 dovecot   20   0 95588 4040 2860 S  0.0  0.2   0:00.01 auth
20717 root      20   0 98632 3808 2884 S  0.0  0.2   0:00.00 sshd
851 root      20   0 99972 3068 2904 S  0.0  0.1   0:00.16 sshd
1226 postfix   20   0 81132 2332 2240 S  0.0  0.1   0:00.00 tlsmgr
784 root      20   0 80860 2192 2100 S  0.0  0.1   0:00.06 master

猫/proc/meminfo

MemTotal:        2097152 kB
MemFree:            3796 kB
Cached:            18472 kB
Buffers:               0 kB
Active:            19628 kB
Inactive:           6712 kB
Active(anon):       3608 kB
Inactive(anon):     4260 kB
Active(file):      16020 kB
Inactive(file):     2452 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097152 kB
SwapFree:        2059452 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:          7868 kB
Shmem:              2708 kB
Slab:            2067000 kB
SReclaimable:    2057576 kB
SUnreclaim:         9424 kB

相关内容