从日志中可以看到,Apache在转发时,有性能瓶颈:
[Fri Jul 13 13:45:34.182455 2018] [core:error] [pid 5801] [client 180.169.139.198:26427] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://server.yesdk.com/v2/?service=YeSDK.Order&productCount=1&yesdkAppKey=1f738f8a7508f345bf3ccbb289cd982a&loginUnique=201807130950115b480553d9478&appId=100224&yesdkAppChannelId=20103&yesdkAppExtra=a0001&gameOrderId=b66395887a144e2d879ee4ce112a06f3_1531446806957_211001010194153&channelId=137&gameNotifyUrl=http%3A%2F%2F118.126.67.203%3A8282%2Forder%2Fgrant&initUnique=201807130949555b480543cbf1f&productId=com.xynet.hxjh.pay_1001&version=1.0&txnItem=%7B%22propId%22%3A%2210851%22%2C%22propNum%22%3A%221%22%7D&yesdkAppId=100032&CpId=128&productExtend=21100101%3B21100101019415
查看Linux系统上的Apache版本:
root@iZbp1brytq53dwektip1igZ:/Project/YeSDK/YeSDK_Server_V2/YesdkServerV2/Api/channel# apache2 -v
Server version: Apache/2.4.12 (Ubuntu)
Server built: Feb 4 2015 14:21:10
Apache httpd使用2.4版本
访问Apache官网,找apache2 httpd官方文档:
http://httpd.apache.org/docs/current/mod/core.html#limitinternalrecursion
LimitInternalRecursion Directive
Determine maximum number of internal redirects and nested subrequests |
|
|
|
|
|
server config, virtual host |
|
Core |
|
core |
An internal redirect happens, for example, when using the Action
directive, which internally redirects the original request to a CGI script. A subrequest is Apache httpd's mechanism to find out what would happen for some URI if it were requested. For example, mod_dir
uses subrequests to look for the files listed in the DirectoryIndex
directive.
LimitInternalRecursion
prevents the server from crashing when entering an infinite loop of internal redirects or subrequests. Such loops are usually caused by misconfigurations.
The directive stores two different limits, which are evaluated on per-request basis. The first number is the maximum number of internal redirects that may follow each other. The second number determines how deeply subrequests may be nested. If you specify only one number, it will be assigned to both limits.
LimitInternalRecursion 5
在Apache配置文件中,有一个变量叫做:
LimitInternalRecursion
默认值为10,也就是默认不需要配置,且值为10。我们的配置文件中并没有特别的配置。
这个值用于限制转发的重定向的并发。这个值,是对Apache起到保护作用的,因为一旦这个值设置过高,那么机器就会同时处理高并发,最终可能导致Apache或者OS宕机。
目前我把这个值在测试机上,设置为100。
经过测试,测试机上没有再发生上述的报警日志。