Hello!
Yeah, with NGINX cores older than 1.9.5 (exclusive), there is a
hard-coded limit, 200, in the NGINX core, on the total number of
subrequests allowed under a single main request.
Starting from NGINX 1.9.5, however, there is no longer any limits on
the total number of subrequests per main request, but only a limit
(50) on the depth of the recursive subrequest chain (which is very
rare in practice).
Best regards,
-agentzh
On Wed, Oct 7, 2015 at 12:55 AM, <i...@ecsystems.nl> wrote:
> I think your lucky getting 200 atm. see
> http://forum.nginx.org/read.php?29,261343
> which I think is the reason here.
>
>
> On Tuesday, October 6, 2015 at 5:28:45 PM UTC+2, David Linenberg wrote:
>>
>> Hello,
>> I am very new to openresty. I am trying to work with
>> ngx.location.capture_multi, and have noticed it is failing when I put more
>> than 200 requests in.
>> My desire is to be able to use ngx.location.capture_multi with thousands
>> of simultaneous requests.
>>
>> A conf file which illustrates the error is below. I am running on a
>> single core AWS microinstance with Amazon Linux.
>>
>> http {
>> server {
>> listen 80;
>>
>> location /hello {
>> content_by_lua '
>> ngx.say("hello")
>> ';
>> }
>>
>> location /grid {
>> content_by_lua '
>> local args = {};
>> for i=1,201 do -- works when
>> last index is 200 or lower, fails at 201
>> args[i] = {"/hello"};
>> end
>> local rslt = {ngx.location.capture_multi(args)}
>> ngx.say("DONE")
>>
>> ';
>> }
>>
>> }
>> }
>>
>> The error I get, when I bump up the args count to 201 or greater is as
>> follows in my error.log file:
>>
>> 2015/10/06 15:24:11 [notice] 3241#0: signal process started
>> 2015/10/06 15:24:11 [alert] 3230#0: *10129 open socket #7 left in
>> connection 2
>> 2015/10/06 15:24:11 [alert] 3230#0: aborting
>> 2015/10/06 15:24:15 [error] 3246#0: *10131 subrequests cycle while
>> processing "/hello", client: 100.1.46.100, server: , request: "GET /grid
>> HTTP/1.1", host: "54.175.150.16"
>> 2015/10/06 15:24:15 [error] 3246#0: *10131 lua entry thread aborted:
>> runtime error: content_by_lua(nginx.conf:27):6: failed to issue subrequest:
>> -1
>> stack traceback:
>> coroutine 0:
>> [C]: in function 'capture_multi'
>> content_by_lua(nginx.conf:27):6: in function
>> <content_by_lua(nginx.conf:27):1>, client: 100.1.46.100, server: , request:
>> "GET /grid HTTP/1.1", host: "54.175.150.16"
>> 2015/10/06 15:24:16 [error] 3246#0: *10132 open()
>> "/home/ec2-user/investingengines/build_linux/resty/html/favicon.ico" failed
>> (13: Permission denied), client: 100.1.46.100, server: , request: "GET
>> /favicon.ico HTTP/1.1", host: "54.175.150.16", referrer:
>> "http://54.175.150.16/grid"
>> [ec2-user@ip-172-31-55-176 resty]$
>>
>> Thanks for any help
>> Dave Linenbe.