Tempo de resposta do servidor

1

Alguém deve, por favor, vir em meu auxílio antes que essa coisa me faça o impensável. Como posso ter uma gota de oceano digital de 16 GB de RAM e 6ores? Correndo no Wordpress com 34 plugins. Vinculado ao Cloudflare e todos os mecanismos de cache no local. No entanto, meu site ainda leva 50s para carregar. Eu pesquisei e pesquisei e googled, tentei todas as coisas que eu poderia encontrar on-line e ainda assim o problema ainda persiste. O problema fica tão pior que quando tenho cerca de 300 usuários em tempo real a qualquer momento, recebo um erro 502. Tenho otimizado, otimizado, otimizado e otimizado e estou tão cansado disso. Alguém deveria vir em meu auxílio por favor. O que devo fazer para tornar meu site rápido o suficiente e evitar o erro http quando muitos usuários em tempo real estão on-line. Eu sei que uma gotícula digital de 6 GB de RAM terá mais de 5000 usuários em tempo real e ainda será muito rápida. Por favor, o que eu não estou fazendo certo? o que estou perdendo? Eu preciso de toda a ajuda que posso conseguir, por favor. Alguém deve me dar uma configuração que irá transportar este tráfego e também as coisas que eu preciso constantemente para manter a velocidade. Por favor me ajude.

Eu sei que isso será sinalizado como fora do tópico. Mas este é o último lugar para onde posso correr. Isso é basicamente todas as configurações ativas que eu tenho no php-fpm

[www]

user = www-data
group = www-data


listen = /run/php/php7.2-fpm.sock


listen.owner = www-data
listen.group = www-data

pm = dynamic


pm.max_children = 5

pm.start_servers = 2

pm.min_spare_servers = 1

pm.max_spare_servers = 3

Isto é o que eu tenho no meu arquivo conf nginx

        user www-data;
    worker_processes auto;
    pid /run/nginx.pid;
    include /etc/nginx/modules-enabled/*.conf;

    events {
        worker_connections 2048;
        # multi_accept on;
    }

    http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        server_tokens off;
        #more_set_headers "Server: wakanda";

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

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

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
        ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GC$;

        ##
        # Logging Settings
        ##

        #access_log /var/log/nginx/access.log;
        access_log off;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_min_length  1000;
        # gzip_buffers 32 16k;
        # gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
        gzip_disable "MSIE [1-6]\.(?!.*SV1)";


        #####
        #Security Headers
        ######

        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-XSS-Protection "1; mode=block" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header Referrer-Policy "no-referrer-when-downgrade" always;
        add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;


        # Optimize session cache
        ssl_session_cache shared:SSL:50m;
        ssl_session_timeout 1d;

        # Enable session tickets
        ssl_session_tickets on;

        # OCSP Stapling
        ssl_stapling on;
        ssl_stapling_verify on;
        resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
        resolver_timeout 2s;


        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;

    }

e aqui está o que eu tenho no mysql

        [mysqld_safe]
    socket      = /var/run/mysqld/mysqld.sock
    nice        = 0

    [mysqld]
    #
    # * Basic Settings
    #
    user        = mysql
    pid-file    = /var/run/mysqld/mysqld.pid
    socket      = /var/run/mysqld/mysqld.sock
    port        = 3306
    basedir     = /usr
    datadir     = /var/lib/mysql
    tmpdir      = /tmp
    lc-messages-dir = /usr/share/mysql
    skip-external-locking
    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    bind-address        = 127.0.0.1
    #
    # * Fine Tuning
    #
    key_buffer_size     = 16M
    max_allowed_packet  = 16M
    thread_stack        = 192K
    thread_cache_size       = 32
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover-options  = BACKUP

    max_heap_table_size    = 64M
    tmp_table_size         = 64M
    max_connections        = 1000
    max_user_connections   = 200
    table_open_cache       = 2000
    join_buffer_size       = 1M
    #thread_concurrency     = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit   = 2M
    query_cache_size        = 16M

    #
    # Error log - should be very few entries.
    #
    log_error = /var/log/mysql/error.log

    expire_logs_days    = 10
    max_binlog_size   = 100M

    #
    # * InnoDB
    #
    #default_table_type            = InnoDB
    # 80% of ram that is dedicated for the database (this needs to be adjusted to your system)
    innodb_buffer_pool_size        = 7G

    innodb_buffer_pool_instances   = 2 
    innodb_log_file_size           = 64M
    innodb_log_files_in_group      = 2

Este é o arquivo conf do site

        server {
            root /var/www/html/wakanda.ng/public;
            index index.php index.html index.htm index.nginx-debian.html;
            server_name wakanda.ng www.wakanda.ng;

        access_log /var/log/nginx/wakanda.ng/wakanda_access_log;
        error_log   /var/log/nginx/wakanda.ng/wakanda_error_log   error;

            location / {
                    #try_files $uri $uri/ =404;
            try_files $uri $uri/ /index.php?q=$uri&$args;
            }

        error_page 401 /custom_401.html;
            location = /custom_401.html {
                    root /usr/share/nginx/html;
                    internal;
            }

        location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
            expires 365d;
        }

            location ~ \.php$ {
                    include snippets/fastcgi-php.conf;
                    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_read_timeout 300;
            }

        # Protect wp-admin
    location /wp-admin {
        auth_basic "Admin Login";
        auth_basic_user_file /var/www/html/wakanda.ng/.htpasswd;
    }

    # Protect wp-login.php script
    location /wp-login\.php$ {
        auth_basic "Admin Login";
        auth_basic_user_file /var/www/html/wakanda.ng/.htpasswd;
    }

    # Allow access to the admin-ajax.php, all the ajax calls
    # are routed this way in WordPress
    location /wp-admin/admin-ajax.php {
        allow all;
    }
            location ~ /\.ht {
                    deny all;
            }

        listen 443 http2 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/wakanda.ng/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/wakanda.ng/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


    }
    server {   
       if ($host = www.wakanda.ng) {
            return 301 https://$host$request_uri;
        } # managed by Certbot


        if ($host = wakanda.ng) {
            return 301 https://$host$request_uri;
        } # managed by Certbot


            listen 80;
            server_name wakanda.ng www.wakanda.ng;
        return 404; # managed by Certbot

    }

Eu não sei o que é necessário e o que não é, então incluí todos eles. O site é wakanda.ng. Você pode visitar para ver por si mesmo.

    
por Atoms 06.11.2018 / 01:04

0 respostas