搞互联网开发也有好几年了,关于Apache的Timeout以前还真没有认真看过。羞!!! 今天一位网友访问不了魔秀, 刚开始没在意,还以为是网络的问题,因为我自己访问着非常正常。打开QQ的远程协助,登陆到对方电脑上,设置了hosts,不管用;ping 也ping不通。在准备放弃并告诉对方是网络原因,没有任何办法的时候,偶尔试着tracert了一下服务器所在机房的网关,发现可以到达,但我们的服务 器就不行。于是猜到是不是TimeOut的问题,增大这个值,重启Apache之后发现果然可以了。FT一下自己。下面把手册里关于timeout这一切 粘到这里来,以后得长个记性。这些天为服务器的负载能力发愁,看手册的时候不少,真的发现有好多之前被自己忽视的却是非常有用的东东。
TimeOut Directive
| Description: | Amount of time the server will wait for certain events before failing a request |
|---|---|
| Syntax: | TimeOut seconds |
| Default: | TimeOut 300 |
| Context: | server config |
| Status: | Core |
| Module: | core |
The TimeOut directive currently defines the amount of time Apache will wait for three things:
- The total amount of time it takes to receive a GET request.
- The amount of time between receipt of TCP packets on a POST or PUT request.
- The amount of time between ACKs on transmissions of TCP packets in responses.
We plan on making these separately configurable at some point down the road. The timer used to default to 1200 before 1.2, but has been lowered to 300 which is still far more than necessary in most situations. It is not set any lower by default because there may still be odd places in the code where the timer is not reset when a packet is sent.
最后再BS一下中国各个网络运营商,看看从天津铁通tracert的结果吧,无语了:
Tracing route to www.moxiu.com [219.238.235.48]
over a maximum of 30 hops:
1 92 ms 46 ms 49 ms 123.57.144.1
2 47 ms 55 ms 49 ms 222.36.97.137
3 * 45 ms 45 ms 222.36.96.17
4 44 ms 45 ms 46 ms 222.36.96.126
5 44 ms 43 ms 46 ms 202.131.16.78
6 83 ms 83 ms 102 ms 219.72.0.25
7 97 ms 82 ms 83 ms 219.72.0.1
8 86 ms 82 ms 83 ms 219.72.0.6
9 78 ms 78 ms * 202.131.16.74
10 82 ms 80 ms 228 ms 202.131.16.73
11 * 82 ms 81 ms 202.101.187.137
12 83 ms 81 ms 80 ms 220.191.133.141
13 80 ms 76 ms 79 ms 61.130.125.37
14 86 ms 87 ms 92 ms 202.97.41.237
15 179 ms 117 ms 178 ms 202.97.36.38
16 181 ms 114 ms * 221.238.222.210
17 114 ms 114 ms 178 ms 221.239.7.50
18 114 ms 180 ms 181 ms 221.239.18.34
19 121 ms 186 ms * 202.99.57.190
20 117 ms 186 ms 118 ms 219.238.235.48
Trace complete.
RSS
twitter