What does slow my system nginx, php-fpm?
<p>9 with nginx and php-fpm.</p>

<p>Everything worked fine until this day notice that this very very slow everything that has to do with php.</p>

<p>Sometimes I get the error</p>

<pre><code>“504 Gateway Time-Out”
</code></pre>

<p>I wonder if there is a way to get scanned that is what is causing this.</p>

<p>Thank you</p>

<p>I have done so OPcache settings:</p>

<pre><code>opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
</code></pre>

<p>Nginx as follows:</p>

<pre><code>    worker_processes  6;

    events {
        worker_connections  8096;
        multi_accept        on;
        use                 kqueue;
    }
    worker_rlimit_nofile 40000;
http {
.....
      proxy_connect_timeout       600;
      proxy_send_timeout          600;
      proxy_read_timeout          600;
      send_timeout                600;
    client_body_buffer_size 10K;
    client_header_buffer_size 1k;
    client_max_body_size 8m;
    large_client_header_buffers 2 1k;

    gzip  on;
    gzip_comp_level  2;
    gzip_min_length  1000;
    gzip_proxied     expired no-cache no-store private auth;
    gzip_types       text/plain application/x-javascript text/xml text/css application/xml;
    server_tokens off;
......
}
</code></pre>

<p>php-fpm like this:</p>

<pre><code>pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
request_terminate_timeout = 30s
request_slowlog_timeout = 10s
slowlog = /var/log/php-fpm/default/slow.log
php_admin_flag[log_errors] = on
</code></pre>

<p>and php.ini like this:</p>

<pre><code>max_execution_time = 300
request_terminate_timeout = 300
</code></pre>

<p>Thanks for all</p>