Yichun Zhang Sent: Monday, October 26, 2015 8:40 PM
> On Tue, Oct 27, 2015 at 12:54 AM, Nelson, Erik - 2 wrote:
> > Do echo_location and echo_async_location cache the location responses
> to memory prior to writing them out?
> >
>
> Nope. These directives themselves do not attempt to buffer the whole
> subrequest responses in memory. But you still need to be careful about
> aggressive buffering in other links along the processing chain.
Thanks
> > For example, suppose I want to concatenate local and remote logs and
> > send them as a single response. If I do something like
> >
> > location /get_local_log {
> > content_by_lua_file /app_root/get_log.lua; }
> >
> > location /get_remote_log {
> > proxy_pass
> > $scheme://remote_server:$server_port/get_local_log?$args;
> > }
> >
> > location /get_combined_log {
> > echo_location /get_local_log $args;
> > echo_location /get_remote_log $args; }
> >
> >
> > Will there be a problem (particularly with memory) if the logs are
> large?
> >
>
> The easiest way to find out is to test large data yourself ;)
>
Fair enough, I just wanted to avoid any obvious problems since I don't have much experience. I think the buffering answer above is the key.
> I'm not sure how your get_log.lua is implemented. Hopefully you use
> streaming processing there (like reading a data chunk of a relatively
> large size, say, 4KB, and then ngx.print it and immediately
> ngx.flush(true) it).
>
Yes, using all the (very helpful) tips you provided in a separate question on this topic.
----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.