网站 502 解决方法
来源:互联网 发布:java class method 编辑:程序博客网 时间:2024/05/16 12:01
Nginx 502 Bad Gateway的含义是请求的PHP-CGI已经执行,但是由于某种原因(一般是读取资源的问题)没有执行完毕而导致PHP-CGI进程终止。
Nginx 504 Gateway Time-out的含义是所请求的网关没有请求到,简单来说就是没有请求到可以执行的PHP-CGI。
出现错误最重要的事查看错误信息;一般错误信息提示能够直接有效的让你找到解决办法。
查看错误日志显示:
[28-Sep-2017 17:31:42] WARNING: [pool www] server reached pm.max_children setting (8), consider raising it[28-Sep-2017 20:18:27] NOTICE: Terminating ...[28-Sep-2017 20:18:27] NOTICE: exiting, bye-bye![28-Sep-2017 20:18:56] NOTICE: fpm is running, pid 1253[28-Sep-2017 20:18:56] NOTICE: ready to handle connections[28-Sep-2017 20:46:05] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 4 total children[28-Sep-2017 23:52:10] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 4 total children[28-Sep-2017 23:52:11] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 5 total children[28-Sep-2017 23:52:12] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 6 total children[28-Sep-2017 23:52:39] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 4 total children
server reached pm.max_children setting (8), consider raising it提示我们服务器子进程已达最大值 pm.max_children 需要增大该值;
seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 6 total children
错误提示需要增大 pm.start_servers 或 pm.min_spare_servers 或 pm.max_spare_servers
; Choose how the process manager will control the number of child processes.; Possible Values:; static - a fixed number (pm.max_children) of child processes;; dynamic - the number of child processes are set dynamically based on the; following directives. With this process management, there will be; always at least 1 children.; pm.max_children - the maximum number of children that can; be alive at the same time.; pm.start_servers - the number of children created on startup.; pm.min_spare_servers - the minimum number of children in 'idle'; state (waiting to process). If the number; of 'idle' processes is less than this; number then some children will be created.; pm.max_spare_servers - the maximum number of children in 'idle'; state (waiting to process). If the number; of 'idle' processes is greater than this; number then some children will be killed.; ondemand - no children are created at startup. Children will be forked when; new requests will connect. The following parameter are used:; pm.max_children - the maximum number of children that; can be alive at the same time.; pm.process_idle_timeout - The number of seconds after which; an idle process will be killed.; Note: This value is mandatory.
; The number of child processes created on startup.; Note: Used only when pm is set to 'dynamic'; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 30 //10 + (50 - 10)/2
经验人士的总结:
一般php-fpm进程占用20~30m左右的内存就按30m算。如果单独跑php-fpm,动态方式起始值可设置物理内存Mem/30M,由于大家一般Nginx、MySQL都在一台机器上,于是预留一半给它们,即php-fpm进程数为$Mem/2/30(单位相同)。
1核2G的服务器配置如下:
pm = dynamicpm.max_children = 50pm.start_servers = 30pm.min_spare_servers = 10pm.max_spare_servers = 50
阅读全文
0 0
- 网站 502 解决方法
- 高并发网站解决方法
- 调试php时网站出现502的解决方法
- 网站流量下降的解决方法
- 网站速度慢及其解决方法
- android开发网站无法访问解决方法
- android开发网站无法访问解决方法
- 网站跨域访问解决方法
- 大型网站负载均衡解决方法
- 服务器网站401错误-解决方法
- 网站漏洞扫瞄时被云盾拦截解决方法
- 分享在linux环境下网站提示502 Bad Gateway的解决方法
- 关于IE弹出垃圾网站的解决方法
- IIS6.0服务器搭建网站无法访问解决方法
- Sybmbian 解决方法有用的技术网站
- 百度不更新网站快照与解决方法
- asp.net网站页面空白故障解决方法
- IIS6.0服务器搭建网站无法访问解决方法
- 基于OpenCV打开摄像头的控制台程序
- Shell终端输出字符的颜色总结
- 树链剖分bzoj3626
- Linux中MAVEN环境配置
- 软件工程论文书写设计步骤及如何降低重复率
- 网站 502 解决方法
- ##好好好####知识图谱的应用#######
- Picasso使用Target无法回调的分析与解决
- 是否可能触发滥用#链接低质量站点规则
- mysql数据库基本语法
- c++ 采集nvidia GPU使用率
- 批量重命名
- 杂七杂八
- Ubuntu下无法手动启动VMware Tools安装