Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有PHP-FPM的Nginx太快达到最大值_Php_Laravel_Nginx - Fatal编程技术网

带有PHP-FPM的Nginx太快达到最大值

带有PHP-FPM的Nginx太快达到最大值,php,laravel,nginx,Php,Laravel,Nginx,我不知道为什么服务器很快就到达了max_儿童。重启php fmp后约2-5分钟 我的服务器:4个vCPU,8GB Ram FPM日志 [19-Mar-2020 11:01:11] WARNING: [pool www] child 6984, script '/home/forge/example.com/public/index.php' (request: "GET /index.php") execution timed out (72.300251 sec), terminating [

我不知道为什么服务器很快就到达了max_儿童。重启php fmp后约2-5分钟 我的服务器:4个vCPU,8GB Ram

FPM日志

[19-Mar-2020 11:01:11] WARNING: [pool www] child 6984, script '/home/forge/example.com/public/index.php' (request: "GET /index.php") execution timed out (72.300251 sec), terminating
[19-Mar-2020 11:01:11] WARNING: [pool www] child 6847, script '/home/forge/example.com/public/index.php' (request: "GET /index.php") execution timed out (60.922255 sec), terminating
[19-Mar-2020 11:01:11] WARNING: [pool www] child 6841, script '/home/forge/example.com/public/index.php' (request: "GET /index.php") execution timed out (78.432021 sec), terminating
[19-Mar-2020 11:01:11] WARNING: [pool www] child 6828, script '/home/forge/example.com/public/index.php' (request: "POST /index.php") execution timed out (71.056632 sec), terminating
FPM形态

pm = dynamic
pm.max_childrent = 120
pm.max_requests = 500
pm.max_spare_servers = 72
pm.min_spare_servers = 24
Nginx形态

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 4k;
        fastcgi_buffers 32 4k;
    }

您是否使用opcache运行服务器?你使用redis吗?您的laravel应用程序需要多长时间才能达到死亡状态(例如,直到完成输出并销毁所有内容为止的执行时间)?@Tschallacka我在没有opacache的情况下运行服务器。我被redis利用了。我认为1-2秒SA Web服务器最好在50毫秒内响应。启用opcache,设置redis并在laravel中启用它。研究如何启用静态缓存,这样就不需要在每个视图中重新渲染动态内容,通过ajax调用执行动态数据更新渲染。将您的请求保持在50毫秒以下。我有一个类似的设置,我的请求小于50毫秒