Undestanding“408请求超时”在Apache和PHP [英] Undestanding “408 Request Timeout” on Apache with PHP

查看:2391
本文介绍了Undestanding“408请求超时”在Apache和PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题描述 - Apache日志

我发现一个与此相似的Apache日志文件的内容:

I found items similar to this one in the Apache log file:

166.147.68.243 [24/Feb/2013:06:06:25 -0500] 19 web-site.com "-" 408 - "-"

我有自定义日志格式和 408 在这里代表的地位。日志格式为:

I’ve got custom log format and 408 here stands for status. The log format is:

LogFormat "%h %t %D %V \"%r\" %>s %b \"%{User-agent}i\"" detailed

和通常在日志文件中的行看起来像

And normally the line in the log file looks like

184.73.232.108 [26/Feb/2013:08:38:16 -0500] 30677 www.site.com "GET /api/search... HTTP/1.1" 200 205 "Zend_Http_Client"

这也是为什么408错误行看起来很奇怪我。无请求被记录,我有什么要优化不知道。

This is why 408 error lines look strange to me. No request is logged and I have no idea on what should be optimized.

问题

如何解决这个问题?
我应该收集哪些附加信息或日志?
什么可能导致的问题?这是错误的东西在服务器上?还是这绝对是一个网络连接问题?

How to tackle the issue? What additional information or logs should I gather? What might cause the issue? Is this something wrong on the server? Or is this absolutely a network connectivity problem?

我解决这个,因为我们的客户抱怨说,他已经得到了他的移动电话408错误。我发现很多记录在日志文件,但我不得不承认,我不知道该怎么该怎么做。

I’m addressing this because our customer complained that he has got 408 error on his mobile phone. I found many records in the log file but I have to admit I don’t know what to do with this.

我自己的研究

有对这个问题已经在这里的几个问题。但人们更具体。就像他们观点,与某些特定的客户端软件和脚本的问题。在这里,我刚刚在iPhone上打开一些网页时出错。

There are several questions on this subject already here. But people are much more specific. Like they discus issues with some specific client software and scripts. Here I just got the error when opening some page on iPhone.

例如在 HTTP,408请求超时,建议做GET请求之前POST。如果我有自定义客户端,我可以做到这一点。但我无法控制用户的浏览器的行为。

For example in HTTP, 408 Request timeout, it is suggested to do the GET request before POST. If I have custom client I can do this. But I can not control the behavior of the user’s browser.

竞猜#1

在互联网搜索和思考,我发现这个问题的http://serverfault.com/questions/383290/too-many-408-error-$c$cs-in-access-log

When searching the Internet and thinking about the issue I found http://serverfault.com/questions/383290/too-many-408-error-codes-in-access-log

的建议是更新 超时 的配置参数恢复到默认值。

The suggestion is to update the Timeout config parameter back to its default value.

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

我试过值30首先是因为我觉得30 seconds值至少应是足够的。 但是,即便用300秒默认值,我继续得到日志中的错误。我做了尾-f 当我在写这篇文字得到在几分钟内超过10行。

I tried the value 30 first because I thought 30 seconds should be enough. But even with 300 seconds default value, I continue to get the errors in the log. I did tail -f when I was writing this text and got more then 10 lines in a few minutes.

对我来说这看起来不完整的解决方案。

To me this does not look a complete solution.

推荐答案

这是我来到了如下回答这个问题有些研究后。这是由我们的主要开发者提供的,我认为这是对主题的很好的解释。

After some studies on the subject I came to the following answer. It is provided by our lead developer and I think it gives good explanation of the subject.

这些错误是很正常的。他们不是一个更大的问题的迹象,但持有的Apache的正常连接打开超过允许更长的时间。

These errors are perfectly normal. They aren't a sign of a larger issue, but normal connections that are holding Apache open for longer than allowed.

例如,遍地运行这些客户端的查询阿帕奇保持开放。 Apache的回应是适当关闭他下来。

For example, client's queries running them over and over kept Apache open. Apache responded by shutting him down appropriately.

如果它没有,除了极少数人可以接管我们的服务器,不允许任何人进行连接。

If it hadn't, than a handful of people could take over our server and not allow anyone else to connect.

大多数情况下,这些错误是由系统来寻找漏洞,你可以通过打开Telnet会话,并任由重新创建它。

Most often these errors are coming from systems looking for exploits, and you can recreate it by opening a telnet session and leaving it open.

与此同时,尾-f访问日志,和X时间内(KeepAliveTimeout的),你会看到你的IP弹出具有相同的错误codeS。

At the same time, tail -f the access log, and within X time (KeepAliveTimeout) you'll see your IP popup with the same error codes.

早在Apache的1.3天,这个错误很常见,但随后2.2走了出来,他们有它删除,直到足够我们的要求将货物退回,因为它给了我们多少人是抱着开放的只是思路口,并且未请求的实际资源,等等。

Back in the days of Apache 1.3, this error was common, but then 2.2 came out and they had it removed until enough of us asked for it to be returned since it give us ideas on how many people are holding open just the port, and not requesting an actual resource, etc.

我觉得没什么应该在这里完成除了确保超时设置为某个合理的值,因为我在原来的问题所描述的。

I think nothing else should be done here except to make sure to set Timeout to some reasonable value as I have described in original question.

这篇关于Undestanding“408请求超时”在Apache和PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆