504504 gatewayytimeout怎么登不了

nginx 504 Gateway Time-out错误解决办法
来源:&&&时间: 20:19:16&&&阅读数:
[导读] 我们经常会发现大量的nginx服务器访问时会提示nginx 504 Gateway Time-out错误了,下面我来总结了一些解决办法,有需要了解的同学可进入参考。一般看来, 这种情况可能是由于nginx默认的fastcgi进程响应的缓
我们经常会发现大量的nginx服务器访问时会提示nginx 504 Gateway Time-out错误了,下面我来总结了一些解决办法,有需要了解的同学可进入参考。
一般看来, 这种情况可能是由于默认的fastcgi进程响应的缓冲区太小造成的, 这将导致fastcgi进程被挂起, 如果你的fastcgi服务对这个挂起处理的不好, 那么最后就极有可能导致504 Gateway Time-out现在的网站, 尤其某些论坛有大量的回复和很多内容的, 一个页面甚至有几百K默认的fastcgi进程响应的缓冲区是8K, 我们可以设置大点在nginx.conf里, 加入:fastcgi_buffers 8 128k这表示设置fastcgi缓冲区为8&128k当然如果您在进行某一项即时的操作, 可能需要nginx的超时参数调大点, 例如设置成60秒:send_timeout 60;我只是调整了这两个参数, 结果就是没有再显示那个超时, 可以说效果不错另一篇文章首先是更改php-fpm的几处配置:把max_children由之前的10改为现在的30,这样就可以保证 有充足的php-cgi进程可以被使用;把_terminate_timeout由之前的0s改为60s,这样php-cgi进程 处理脚本的超时时间就是60秒,可以防止进程都被挂起,提高利用效率。接着再更改nginx的几个配置项,减少FastCGI的请求次 数,尽量维持buffers不变:& fastcgi_buffers由 4 64k 改为 2 256k; & fastcgi_buffer_size 由 64k 改为 128K; & fastcgi_busy_buffers_size 由 128K 改为 256K; & fastcgi_temp_file_write_size 由 128K 改为 256K。好了,重新加载php-fpm和nginx的配置,再次测试,至今两周时间内没有再出现504 Gateway Time-out的情况,算是达到效果了。另外,php-fpm的默认静态处理方式会使得php-cgi的进程长期占用内存而无法释放,这也是导致nginx出错的原因之一,因此可以将php-fpm的处理方式改成模式。 apache-like
除非特别声明,PHP100新闻均为原创或投稿报道,转载请注明作者及原文链接原文地址:
延伸阅读 More
视频教程 Video
网站服务:
会员问题 :
友情链接 :
网站投稿 :
@php100官方
php100官方微信
Copyright (C) 2007-, All Rights Reserved 版权所有 粤ICP备号-4
粤ICP备号-3504 Gateway Timeout 是什么意思_百度知道
504 Gateway Timeout 是什么意思
网页上总是提示504 Gateway Timeout 是什么意思
我有更好的答案
意思为:网关超时!
网关(Gateway)又称网间连接器、协议转换器。网关在传输层上以实现网络互连,是最复杂的网络互连设备,仅用于两个高层协议不同的网络互连。网关的结构也和路由器类似,不同的是互连层。网关既可以用于广域网互连,也可以用于局域网互连。 网关是一种充当转换重任的计算机系统或设备。在使用不同的通信协议、数据格式或语言,甚至体系结构完全不同的两种系统之间,网关是一个翻译器。与网桥只是简单地传达信息不同,网关对收到的信息要重新打包,以适应目的系统的需求。同时,网关也可以提供过滤和安全功能。大多数网关运行在OSI 7层协议的顶层--应用层。
网关实质上是一个网络通向其他网络的IP地址。比如有网络A和网络B,网络A的IP地址范围为“192.168.1.1~192. 168.1.254”,子网掩码为...
其他类似问题
5人觉得有用
为您推荐:
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁后使用快捷导航没有帐号?
查看: 1892|回复: 5
新人欢迎积分1 阅读权限60积分2739精华0UID帖子金钱3704 威望0
Lv.6, 积分 2739, 距离下一级还需 2261 积分
UID帖子威望0 多玩草0 草
凡是打开我的战绩页出现这个问题的朋友
修改您的 dns 服务器为 8.8.8.8
如果还是不OK的朋友,可以尝试我们开发的DNS小工具:
本帖最后由 盒子喵 于
15:00 编辑
你的贴子很不错。推荐一下! O(∩_∩)O.
总评分:&金钱 + 20&
丨 丨&& 丨 丨
新人欢迎积分0 阅读权限50积分2349精华0UID4045838帖子金钱5256 威望0
Lv.5, 积分 2349, 距离下一级还需 151 积分
UID4045838帖子威望0 多玩草559 草
新人欢迎积分1 阅读权限40积分754精华0UID帖子金钱5503 威望2
Lv.4, 积分 754, 距离下一级还需 246 积分
UID帖子威望2 多玩草50 草
额 学习学习!!
新人欢迎积分1 阅读权限30积分166精华0UID帖子金钱1522 威望0
Lv.3, 积分 166, 距离下一级还需 84 积分
UID帖子威望0 多玩草0 草
终于解决了& && & 太开心了
新人欢迎积分0 阅读权限50积分2349精华0UID4045838帖子金钱5256 威望0
Lv.5, 积分 2349, 距离下一级还需 151 积分
UID4045838帖子威望0 多玩草559 草
新人欢迎积分1 阅读权限30积分62精华0UID帖子金钱395 威望0
Lv.3, 积分 62, 距离下一级还需 188 积分
UID帖子威望0 多玩草0 草
先留个脚印。回去看看去。
需要金钱:1100
Powered by
手机盒子客户端点击或扫描下载Error 504 Gateway timeout - Server Fault
to customize your list.
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I would like to know if an error 504 Gateway timeout always come from the load balancer or it can also be originated from Apache and the PHP code it's running ?
It usually happens when the load balancer is waiting for a response from apache and apache is not giving a response within the timeout period of load balancer. So it returns a 504 gateway timeout. About what causes apache to not respond is something only you can say as you have not given much background information on what apache is serving. Look at apache logs to know more details . usually access logs and error logs. Increase the timeout value of loadbalancer, to see if it helps. It is always good to have clustering on apache so you dont get 504 because of a dead apache instance. I think mod_proxy allows you to achieve software clustering. I am not sure check out on apache site.
Usually from balancing because Apache(mod_php) or PHP(FastCGI) down or busy.
Sure it can be from php. If php script is in some loop and wont 'spit' out the content connection will eventually time out and balancer will report gateway timeout.
That 'loop' does not necessarily need to be loop, it can be waiting on connection to some service to read data from like mysql/memcache or something...
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Server Fault works best with JavaScript enabled}

我要回帖

更多关于 502 gateway timeout 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信