tgq123888 发表于 2019-11-18 15:56:54

求助:nignx运行一段时间之后错误提示内存不足Cannot allocate...

小弟接触lnmp不久,初来乍到,就遇到一个棘手问题,希望论坛能有大神帮忙解答,感激不尽。首先贴上nginx日志错误代码:

2019/09/26 21:45:57 17619#0: *20806850 malloc(1768860345) failed (12: Cannot allocate memory) while reading client request headers, client: 182.119.229.126, server: _, request: "GET /Uploads/Picture/2019-08-10/5d4e352ccdc4e.jpg HTTP/1.1"
2019/09/26 21:45:57 17619#0: *20806859 malloc(1768860345) failed (12: Cannot allocate memory) while reading client request headers, client: 182.119.229.126, server: _, request: "GET /guanwang/5b56e1521e4b8.png HTTP/1.1"
2019/09/26 21:45:57 17619#0: *20806861 malloc(1768860345) failed (12: Cannot allocate memory) while reading client request headers, client: 182.119.229.126, server: _, request: "GET /guanwang/5b56e1521e911.jpg HTTP/1.1"
2019/09/26 21:45:57 17619#0: *20806862 malloc(1768860345) failed (12: Cannot allocate memory) while reading client request headers, client: 43.231.47.56, server: _, request: "GET /game.php?action=play&game_id=113&server_id=14091 HTTP/1.1"


lnmp每次重启一段时间之后,就会出现上面的提示,说是内存不足,使用free -m查看的时候,内存可用(available)这里还剩下3G多,所以百思不得其解,希望有大神能回答一下,有偿也是可以的。

tgq123888 发表于 2019-11-18 17:25:31

已解决,,小白了内存里面buff/cache占用了原本free的内存,需要手动清除一下:
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

cyr11 发表于 2019-12-13 16:40:45

还不如每天重启一次来的实在
页: [1]
查看完整版本: 求助:nignx运行一段时间之后错误提示内存不足Cannot allocate...