VPS侦探论坛

 找回密码
 注册
查看: 121|回复: 2

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

[复制链接]
发表于 2019-11-18 15:56:54 | 显示全部楼层 |阅读模式



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

2019/09/26 21:45:57 [emerg] 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 [emerg] 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 [emerg] 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 [emerg] 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多,所以百思不得其解,希望有大神能回答一下,有偿也是可以的。
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 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
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 3 天前 | 显示全部楼层



还不如每天重启一次来的实在
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2019-12-16 00:26 , Processed in 0.043277 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表