Hello!
On Mon, Apr 13, 2015 at 12:02 AM, Kyle Andrews wrote:
>
> Is having a high buffer a problem for a production website?
>
This is usually a sign of ill-written regex that is ambiguous. And you
should try to optimize your patterns instead of increasing the buffer
infinitely.
> Here is the replacement that requires a large buffer:
>
> replace_filter "<a
> href=\"/main/request_commenting\"(.*)ability</a>\n " "";
>
".*" is greedy and matches everything, which we should always avoid at
any cost. Maybe you can limit the pattern or use the nongreedy version
(".*?")?
If the content you really want to replace in that submatch group is
very big, then you should set the max buffering size to that size
accordingly. Because without seeing the end pattern (in your case, the
"ability</a>\n  " part), the ngx_replace_filter module cannot
make a decision on the partial matched data it's already seen and thus
buffer it all. If your target content to be matched is never that big,
then you can safely ignore the error message because the
ngx_replace_filter will just give up matching and replacing, which
does no harm anyway.
Regards,
-agentzh