Растет потребление ОЗУ

Обсуждение установки и настройки поддерживаемых вебсерверов, а также работы с ними.
Ответить
Аватара пользователя
con
Сообщения: 84
Зарегистрирован: Вс мар 15, 2020 11:58 am

Растет потребление ОЗУ

Сообщение con » Пн ноя 01, 2021 11:34 am

Кто знает, в чем может крыться причина постепенного роста используемой ОЗУ на сервере? За последние 10 дней выросло с 3 до 9 ГБ. Растет плавно. Такое впечатление, что где-то не правильно что-то настроено. На сервере 12ГБ ОЗУ и 6 ядер.
Содержимое основного конфига NGINX

Код: Выделить всё

user  nginx nginx;
worker_processes  6;

pcre_jit on;

## Add modules
#
#load_module "/usr/lib64/nginx/modules/ngx_http_cache_purge_module.so";
#load_module "/usr/lib64/nginx/modules/ngx_http_push_stream_module.so";
#load_module "/usr/lib64/nginx/modules/ngx_pagespeed.so";
#load_module "/usr/lib64/nginx/modules/ngx_http_brotli_filter_module.so";
#load_module "/usr/lib64/nginx/modules/ngx_http_brotli_static_module.so";


error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;
pid        /var/run/nginx.pid;

events {
    worker_connections  4096;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"'
                      'cs=$upstream_cache_status';
    charset utf-8;
    access_log  /var/log/nginx/access.log  main;

# ограничиваем скорость загрузки до 150 кб/сек для всех сайтов
limit_rate 150k;

    sendfile            on;
    tcp_nopush         on;
    tcp_nodelay         on;
    reset_timedout_connection on;
    keepalive_timeout  60;
    server_tokens       off;
    server_names_hash_max_size 128;
    server_names_hash_bucket_size 256;

    client_header_timeout 15m;
    client_body_timeout 15m;
    send_timeout 15m;

    client_max_body_size 700m;
    connection_pool_size 256;
    client_body_buffer_size 1024k;
    client_header_buffer_size 8k;

    gzip  on;
    gzip_min_length 100;
    gzip_comp_level 5;
    gzip_types text/plain text/css text/javascript;
    gzip_disable "msie6";

    #proxy_temp_path /var/lib/nginx/proxy 1 2;
    #proxy_cache_valid 20s;
    #proxy_cache_key $scheme$proxy_host$request_uri$cookie_user;
    #proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:400m inactive=120m max_size=500M;
    #proxy_cache_min_uses 2;


    proxy_cache_valid 10s;
    proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=one:100m max_size=300M;
    proxy_cache_path /var/lib/nginx/cache1 levels=1:2 keys_zone=two:100m max_size=300M;

    proxy_temp_path /var/lib/nginx/proxy 1 2;
    proxy_ignore_headers Expires Cache-Control;
    proxy_cache_use_stale error timeout invalid_header http_502;
    proxy_cache_bypass $cookie_session;
    proxy_no_cache $cookie_session;
    proxy_cache_min_uses 2;

    limit_conn_zone $binary_remote_addr zone=lone:10m;
    limit_req_zone $binary_remote_addr zone=ltwo:10m rate=5r/s;
    limit_req_zone $binary_remote_addr zone=lstrict:10m rate=1r/s;
    limit_req_zone $binary_remote_addr zone=highspeed:10m rate=10r/s;

#    fastcgi_cache_path /var/lib/nginx/fpm levels=1:2 keys_zone=fcgi:32m max_size=256m;
    fastcgi_cache_path /tmp/nginx_cache levels=1:2 keys_zone=fcgi:32m max_size=256m;

#    fastcgi_cache_path /var/lib/nginx/fpm2 levels=1:2 keys_zone=fcgi2:32m max_size=256m;
    fastcgi_cache_path /tmp/nginx_cache2 levels=1:2 keys_zone=fcgi2:32m max_size=256m;


    fastcgi_cache_key "$scheme$request_method$host$request_uri$cookie_user";
    fastcgi_temp_path /var/lib/nginx/fastcgi 1 2;
    fastcgi_ignore_headers Expires Cache-Control;
    fastcgi_cache_use_stale error timeout invalid_header;
    # fastcgi_param PHP_ADMIN_VALUE "display_errors=off";

    limit_conn_zone $binary_remote_addr zone=lfcgi:10m;
    limit_req_zone $binary_remote_addr zone=lfsci2:10m rate=5r/s;

    resolver 8.8.8.8 8.8.4.4 valid=300s ipv6=off;
    resolver_timeout 5s;

    map $http_accept $webp_suffix {
        "~*webp" ".webp";
    }



    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    ModSecurityEnabled off;
    ModSecurityConfig modsecurity.conf;
    include /etc/nginx/conf.d/*.conf;

    index index.php index.html index.htm;

    server {
        root         /var/www/html;
        access_log /etc/nginx/vhost_logs/default_access;
        error_log /etc/nginx/vhost_logs/default_error;
        location / {
            root                     /var/www/html;
            index                    index.php index.html index.htm;
        }
    }


include /etc/nginx/sites-available/*.conf;

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;
    #    root         html;

    #    location / {
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;
    #    root         html;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #    }
    #}

}

Centos7

Аватара пользователя
con
Сообщения: 84
Зарегистрирован: Вс мар 15, 2020 11:58 am

Re: Растет потребление ОЗУ

Сообщение con » Пн ноя 01, 2021 1:02 pm

Возможно, тому кто лучше разбирается в тюнинге сервера будет понятней в чем дело и сможет подсказать. Перезагрузил сервис NGINX и ОЗУ опустилась с 9 обратно до 3.
Какие конфиги NGINX могут спровоцировать постепенное заполнение ОЗУ?
Centos7

Ответить