部署NGINX+MongoDB+GridFS文件服务器出现的内存溢出问题

tongchen1231 2015-11-06 11:41:44
环境
------------------
VMware Fusion下CentOS7 x64 虚拟机,4GB内存,300GB硬盘,i5 CPU x 2
Nginx 1.9.6 使用./configure方式安装
Nginx-gridfs latest 使用clone git repo方式安装
MongoDB 3.0.7 使用yum方式安装,使用gfs数据库

问题描述
------------------
上传文件后,浏览器中请求:http://<nginx server ip>:<port>/gfs/<my file> 浏览器出现“无法打开页面”的错误,查看错误日志,http error code 500。error.log中显示:
malloc(18446744056529682432) failed (12: Cannot allocate memory), client: <Client IP>, server: localhost, request: "GET /gfs/test2.zip HTTP/1.1", host: "<Nginx server IP>"

一些配置
------------------
ulimit -n: 65535

free -h:
Mem: total: 3.7G | used: 885M | free: 2.0G | shared: 11M | buff/cache: 881M | available: 2.6G
Swap: total: 2.0G| used: 0B | free 2.0G

nginx -V:

configure arguments: --prefix=/usr/local/nginx --add-module=/usr/local/nginx-gridfs --with-openssl=/usr/include/openssl


nginx-conf:
worker_processes 1;
events {
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8001;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /gfs/ {
gridfs gfs field=filename type=string;
mongo <MongoDB IP>:27017;
}
}
}

此问题何解?谢谢!
...全文
322 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
熊仔哥 2016-04-22
  • 打赏
  • 举报
回复
碰到同样问题,目前我判断是数据存储格式问题,mongodb3.0之后数据存储驱动变更,而插件的驱动不支持新驱动的格式 3.0之后是混合驱动,使用3.0之前的可视化工具传上的图片可以显示, 3.0之前的mongo版本没任何问题 此问题只能等支持3.0以上的mongoc驱动开发出来了

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧