Nginx memory consumption gradaully increase and reaches to 100%

1.7k Views Asked by At

We are nginx in kubernetes(GKE). Nginx is streaming files from google filestore which is mounted on the nginx pod.

Nginx memory consumptions starts to increase as soon as we start streaming those file. Eventually it reaches to 100% over a period of day or two and pods gets restarted. We are have not been able to figure out what could be the probable issue which causing memory consumption to go 100%.

Below is the nginx configuration.

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' '*';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
        add_header 'Access-Control-Max-Age' 1728000;

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}
}

Google file store is mounted mounted at

/usr/share/nginx/html
0

There are 0 best solutions below