How can the number of parallel/redundant open streams/temp_files be controlled/limited?

Maxim Dounin mdounin at
Wed Jun 25 00:30:02 UTC 2014


On Tue, Jun 24, 2014 at 07:51:04PM -0400, Paul Schlie wrote:

> Thank you; however it appears to have no effect on reverse proxy_store'd static files?

Yes, it's part of the cache machinery.  The proxy_store 
functionality is dumb and just provides a way to store responses 
received, nothing more.

> (Which seems odd, if it actually works for cached files; as both 
> are first read into temp_files, being the root of the problem.)

See above (and below).

> Any idea on how to prevent multiple redundant streams and 
> corresponding temp_files being created when reading/updating a 
> reverse proxy'd static file from the backend?

You may try to do so using limit_conn, and may be error_page and 
limit_req to introduce some delay.  But unlikely it will be a 
good / maintainable / easy to write solution.

> (Out of curiosity, why would anyone ever want many multiple 
> redundant streams/temp_files ever opened by default?)

You never know if responses are going to be the same.  The part 
which knows (or, rather, tries to) is called "cache", and has 
lots of directives to control it.

Maxim Dounin

More information about the nginx mailing list