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

环境
------------------
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://&lt;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;        
        }
    }
}

此问题何解?谢谢!

阅读 6k
1 个回答
新手上路,请多包涵

亲,这个问题你解决了?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏