apache LimitInternalRecursion 问题

11 篇文章 0 订阅

从日志中可以看到,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

Description:

Determine maximum number of internal redirects and nested subrequests

Syntax:

LimitInternalRecursion number [number]

Default:

LimitInternalRecursion 10

Context:

server config, virtual host

Status:

Core

Module:

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。

经过测试,测试机上没有再发生上述的报警日志。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值