搜索

首页  >  问答  >  正文

centos7 - 部署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://<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;        
        }
    }
}

此问题何解?谢谢!

PHPzPHPz2751 天前809

全部回复(1)我来回复

  • ringa_lee

    ringa_lee2017-05-16 17:22:50

    亲,这个问题你解决了?

    回复
    0
  • 取消回复