Skip to content

Commit 2b37a7c

Browse files
committed
docs: documented the max concurrent subrequest count limitation and max error log line size limit.
1 parent 9da8286 commit 2b37a7c

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

README

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,14 @@ Nginx API for Lua
10401040
while Lua booleans result in literal "true" or "false" strings. And the
10411041
"ngx.null" constant will yield the "null" string output.
10421042

1043+
There is a hard-coded length limitation on the error messages in the
1044+
Nginx core. It is 2048 bytes at most, including the trailing newlines
1045+
and the leading timestamps. You can manually modify this limit by
1046+
modifying the "NGX_MAX_ERROR_STR" macro definition in the
1047+
"src/core/ngx_log.h" file in the Nginx source tree. If the message size
1048+
exceeds this limit, the Nginx core will truncate the message text
1049+
automatically.
1050+
10431051
ngx.ctx
10441052
context: *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*,
10451053
header_filter_by_lua**
@@ -1393,6 +1401,17 @@ Nginx API for Lua
13931401
headers should be ignored by setting proxy_pass_request_headers to "off"
13941402
in subrequest locations.
13951403

1404+
There is a hard-coded upper limit on the number of concurrent
1405+
subrequests every main request. In older versions of Nginx, the limit is
1406+
50, which is then increased to 200 in recent Nginx "1.1.x" releases. You
1407+
can manually edit this limit by modifying the definition of the
1408+
"NGX_HTTP_MAX_SUBREQUESTS" macro in the
1409+
"nginx/src/http/ngx_http_request.h" file in the Nginx source tree. When
1410+
you are exceeding this limit, you will get the following error message
1411+
in your "error.log" file:
1412+
1413+
[error] 13983#0: *1 subrequests cycle while processing "/uri"
1414+
13961415
Please also refer to restrictions on capturing locations that include
13971416
Echo Module directives.
13981417

@@ -2314,6 +2333,14 @@ Nginx API for Lua
23142333
The "log_level" argument can take constants like "ngx.ERR" and
23152334
"ngx.WARN". Check out Nginx log level constants for details.
23162335

2336+
There is a hard-coded length limitation on the error messages in the
2337+
Nginx core. It is 2048 bytes at most, including the trailing newlines
2338+
and the leading timestamps. You can manually modify this limit by
2339+
modifying the "NGX_MAX_ERROR_STR" macro definition in the
2340+
"src/core/ngx_log.h" file in the Nginx source tree. If the message size
2341+
exceeds this limit, the Nginx core will truncate the message text
2342+
automatically.
2343+
23172344
ngx.flush
23182345
syntax: *ngx.flush(wait?)*
23192346

README.markdown

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,8 @@ It is equivalent to
982982

983983
Lua `nil` arguments are accepted and result in literal `"nil"` strings while Lua booleans result in literal `"true"` or `"false"` strings. And the `ngx.null` constant will yield the `"null"` string output.
984984

985+
There is a hard-coded length limitation on the error messages in the Nginx core. It is `2048` bytes at most, including the trailing newlines and the leading timestamps. You can manually modify this limit by modifying the `NGX_MAX_ERROR_STR` macro definition in the `src/core/ngx_log.h` file in the Nginx source tree. If the message size exceeds this limit, the Nginx core will truncate the message text automatically.
986+
985987
ngx.ctx
986988
-------
987989
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua**
@@ -1335,6 +1337,12 @@ subrequests, an "Accept-Encoding: gzip" header in the main request may result
13351337
in gzipped responses that cannot be handled properly in Lua code. Original request headers should be ignored by setting
13361338
[proxy_pass_request_headers](http://wiki.nginx.org/HttpProxyModule#proxy_pass_request_headers) to `off` in subrequest locations.
13371339

1340+
There is a hard-coded upper limit on the number of concurrent subrequests every main request. In older versions of Nginx, the limit is `50`, which is then increased to `200` in recent Nginx `1.1.x` releases. You can manually edit this limit by modifying the definition of the `NGX_HTTP_MAX_SUBREQUESTS` macro in the `nginx/src/http/ngx_http_request.h` file in the Nginx source tree. When you are exceeding this limit, you will get the following error message in your `error.log` file:
1341+
1342+
1343+
[error] 13983#0: *1 subrequests cycle while processing "/uri"
1344+
1345+
13381346
Please also refer to restrictions on [capturing locations that include Echo Module directives](http://wiki.nginx.org/HttpLuaModule#Locations_With_HttpEchoModule_Directives).
13391347

13401348
ngx.location.capture_multi
@@ -2233,6 +2241,8 @@ Lua `nil` arguments are accepted and result in literal `"nil"` string while Lua
22332241

22342242
The `log_level` argument can take constants like `ngx.ERR` and `ngx.WARN`. Check out [Nginx log level constants](http://wiki.nginx.org/HttpLuaModule#Nginx_log_level_constants) for details.
22352243

2244+
There is a hard-coded length limitation on the error messages in the Nginx core. It is `2048` bytes at most, including the trailing newlines and the leading timestamps. You can manually modify this limit by modifying the `NGX_MAX_ERROR_STR` macro definition in the `src/core/ngx_log.h` file in the Nginx source tree. If the message size exceeds this limit, the Nginx core will truncate the message text automatically.
2245+
22362246
ngx.flush
22372247
---------
22382248
**syntax:** *ngx.flush(wait?)*

doc/HttpLuaModule.wiki

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,8 @@ It is equivalent to
944944
945945
Lua <code>nil</code> arguments are accepted and result in literal <code>"nil"</code> strings while Lua booleans result in literal <code>"true"</code> or <code>"false"</code> strings. And the <code>ngx.null</code> constant will yield the <code>"null"</code> string output.
946946
947+
There is a hard-coded length limitation on the error messages in the Nginx core. It is <code>2048</code> bytes at most, including the trailing newlines and the leading timestamps. You can manually modify this limit by modifying the <code>NGX_MAX_ERROR_STR</code> macro definition in the <code>src/core/ngx_log.h</code> file in the Nginx source tree. If the message size exceeds this limit, the Nginx core will truncate the message text automatically.
948+
947949
== ngx.ctx ==
948950
'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*''
949951
@@ -1295,6 +1297,12 @@ subrequests, an "Accept-Encoding: gzip" header in the main request may result
12951297
in gzipped responses that cannot be handled properly in Lua code. Original request headers should be ignored by setting
12961298
[[HttpProxyModule#proxy_pass_request_headers|proxy_pass_request_headers]] to <code>off</code> in subrequest locations.
12971299
1300+
There is a hard-coded upper limit on the number of concurrent subrequests every main request. In older versions of Nginx, the limit is <code>50</code>, which is then increased to <code>200</code> in recent Nginx <code>1.1.x</code> releases. You can manually edit this limit by modifying the definition of the <code>NGX_HTTP_MAX_SUBREQUESTS</code> macro in the <code>nginx/src/http/ngx_http_request.h</code> file in the Nginx source tree. When you are exceeding this limit, you will get the following error message in your <code>error.log</code> file:
1301+
1302+
<geshi lang="text">
1303+
[error] 13983#0: *1 subrequests cycle while processing "/uri"
1304+
</geshi>
1305+
12981306
Please also refer to restrictions on [[#Locations_With_HttpEchoModule_Directives|capturing locations that include Echo Module directives]].
12991307
13001308
== ngx.location.capture_multi ==
@@ -2169,6 +2177,8 @@ Lua <code>nil</code> arguments are accepted and result in literal <code>"nil"</c
21692177
21702178
The <code>log_level</code> argument can take constants like <code>ngx.ERR</code> and <code>ngx.WARN</code>. Check out [[#Nginx log level constants|Nginx log level constants]] for details.
21712179
2180+
There is a hard-coded length limitation on the error messages in the Nginx core. It is <code>2048</code> bytes at most, including the trailing newlines and the leading timestamps. You can manually modify this limit by modifying the <code>NGX_MAX_ERROR_STR</code> macro definition in the <code>src/core/ngx_log.h</code> file in the Nginx source tree. If the message size exceeds this limit, the Nginx core will truncate the message text automatically.
2181+
21722182
== ngx.flush ==
21732183
'''syntax:''' ''ngx.flush(wait?)''
21742184

0 commit comments

Comments
 (0)