我们是 Kubernetes(GKE)中的 nginx。Nginx 是来自安装在 nginx pod 上的 google 文件存储的流式传输文件。
一旦我们开始流式传输这些文件,Nginx 的内存消耗就会开始增加。最终它会在一两天内达到 100%,并且 Pod 会重新启动。我们无法弄清楚导致内存消耗达到 100% 的可能问题。
下面是nginx配置。
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;
}
}
}
谷歌文件存储安装在
/usr/share/nginx/html