今年買了一臺2核4G的主機,把4核8G的降配下來。
結果:機器沒有啟動任務程序,就占用2.5G內(nèi)存。
?
total used free shared buff/cache available Mem:
3.7G 2.5G 1.0G 64M 159M 972M Swap: 0B 0B 0B
阿里工程師回復:
1、top,然后按大寫的M對占用內(nèi)存的進程進行排序
2、free -m
top:
Tasks: 97 total, 1 running, 96 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.0 us, 0.5 sy, 0.0 ni, 98.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3881688 total, 929616 free, 2645168 used, 306904 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 922736 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
889 root 20 0 474660 32132 72 S 0.0 0.8 0:11.79 dockerd
453 root 20 0 341060 27364 716 S 0.0 0.7 0:00.91 firewalld
1288 root 10 -10 144920 20652 3620 S 3.3 0.5 20:44.46 AliYunDun
944 root 20 0 343864 15812 176 S 0.0 0.4 0:05.04 containerd
885 root 20 0 562884 12900 80 S 0.0 0.3 0:04.87 tuned
812 root 20 0 113568 12492 0 S 0.0 0.3 0:00.00 dhclient
894 root 20 0 806092 9336 3784 S 0.0 0.2 0:37.64 aliyun-service
395 polkitd 20 0 535040 8392 1264 S 0.0 0.2 0:00.24 polkitd
405 root 20 0 295512 5968 4012 S 0.0 0.2 0:10.61 rsyslogd
27180 root 20 0 148688 5740 4428 S 0.0 0.1 0:00.10 sshd
336 root 20 0 37284 5400 4924 S 0.0 0.1 0:17.93 systemd-journal
1252 root 20 0 214292 3972 16 S 0.0 0.1 0:01.35 php-fpm
1266 www 20 0 214292 3968 8 S 0.0 0.1 0:00.00 php-fpm
1267 www 20 0 214292 3968 8 S 0.0 0.1 0:00.00 php-fpm
1261 www 20 0 214292 3964 8 S 0.0 0.1 0:00.00 php-fpm
1262 www 20 0 214292 3964 8 S 0.0 0.1 0:00.00 php-fpm
1263 www 20 0 214292 3964 8 S 0.0 0.1 0:00.00 php-fpm
free -m
[root@izwz9947gr37kg75oe64tkz ~]# free -m
total used free shared buff/cache available
Mem: 3790 2584 906 72 299 899
Swap: 0 0 0
卸載寶塔后:
[root@izwz9947gr37kg75oe64tkz ~]# top
top - 13:28:49 up 13:38, 4 users, load average: 0.07, 0.09, 0.07
Tasks: 89 total, 2 running, 87 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st
KiB Mem : 3881688 total, 801700 free, 2637216 used, 442772 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 928240 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
889 root 20 0 474660 32132 72 S 0.0 0.8 0:11.86 dockerd
453 root 20 0 341060 27364 716 S 0.0 0.7 0:00.91 firewalld
1288 root 10 -10 144920 21148 4116 S 1.9 0.5 20:55.11 AliYunDun
944 root 20 0 343864 15812 176 S 0.0 0.4 0:05.07 containerd
885 root 20 0 562884 12900 80 S 0.0 0.3 0:04.90 tuned
812 root 20 0 113568 12492 0 S 0.0 0.3 0:00.00 dhclient
894 root 20 0 806092 9364 3808 S 0.0 0.2 0:37.87 aliyun-service
395 polkitd 20 0 535040 8580 1452 S 0.0 0.2 0:00.25 polkitd
405 root 20 0 295512 6484 4520 S 0.0 0.2 0:10.73 rsyslogd
336 root 20 0 37284 5992 5516 S 0.0 0.2 0:18.13 systemd-journal
27180 root 20 0 148688 5740 4428 S 0.0 0.1 0:00.12 sshd
27667 root 20 0 148688 5740 4428 S 0.0 0.1 0:00.06 sshd
27710 root 20 0 145788 4928 3696 S 0.0 0.1 0:00.00 sshd
27712 root 20 0 145788 4788 3556 S 0.0 0.1 0:00.00 sshd
1 root 20 0 191064 3104 1584 S 0.0 0.1 0:03.12 systemd
27711 sshd 20 0 106200 2444 1428 S 0.0 0.1 0:00.00 sshd
差不了多少:
total used free shared buff/cache available
Mem: 3790 2576 780 72 433 905
Swap: 0 0 0
查占用內(nèi)存詳情,前10:
[root@izwz9947gr37kg75oe64tkz ~]# ps aux|head -1; ps aux | sort -k4nr | head -10
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 889 0.0 0.8 474660 32132 ? Ssl Nov06 0:11 /usr/bin/dockerd -H fd://
root 453 0.0 0.7 341060 27364 ? Ssl Nov06 0:00 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
root 1288 2.5 0.5 144920 21148 ? S<sl Nov06 21:01 /usr/local/aegis/aegis_client/aegis_11_13/AliYunDun
root 944 0.0 0.4 343864 15812 ? Ssl Nov06 0:05 /usr/bin/containerd
root 812 0.0 0.3 113568 12492 ? Ss Nov06 0:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient--eth0.lease -pf /var/run/dhclient-eth0.pid -H izwz9947gr37kg75oe64tkz eth0
root 885 0.0 0.3 562884 12900 ? Ssl Nov06 0:04 /usr/bin/python -Es /usr/sbin/tuned -l -P
polkitd 395 0.0 0.2 535040 8580 ? Ssl Nov06 0:00 /usr/lib/polkit-1/polkitd --no-debug
root 894 0.0 0.2 806092 9412 ? Ssl Nov06 0:38 /usr/local/share/aliyun-assist/2.2.3.247/aliyun-service
postfix 27752 0.0 0.1 95204 5088 ? S 13:29 0:00 pickup -l -t unix -u
root 27180 0.0 0.1 148688 5740 ? Ss 13:20 0:00 sshd: root@pts/2
阿里工程師回復2:
firewalld:不需要,先停止
aegis_client:卸載云安全中心插件
重啟服務器
? ????????只釋放了不幾M內(nèi)存。
阿里工程師回復3:
在/proc/meminfo中看到有hugepage占用了內(nèi)存,查看/etc/sysctl.conf中有相應的參數(shù)設置。您可以在/etc/sysctl.conf中把該參數(shù)注釋,然后重啟系統(tǒng)再查看一下內(nèi)存使用情況。
重啟服務器后:
[root@izwz9947gr37kg75oe64tkz ~]# free -m
total used free shared buff/cache available
Mem: 3790 154 3323 8 313 3404
Swap: 0 0 0
結論:hugepage是大頁內(nèi)存,不是虛擬內(nèi)存,ECS對配置hugepage沒有限制,但是配置之后,系統(tǒng)會為hugepage預留內(nèi)存。文章來源:http://www.zghlxwxcb.cn/news/detail-408848.html
總結解決問題,還得找專業(yè)人的。文章來源地址http://www.zghlxwxcb.cn/news/detail-408848.html
到了這里,關于阿里云虛擬主機內(nèi)存占用大問題解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!