Welcome! Log In Create A New Profile

Advanced

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

Paul Schlie
July 01, 2014 10:18AM
Then how could multiple streams and corresponding temp_files ever be created upon successive requests for the same $uri with "proxy_cache_key $uri" and "proxy_cache_lock on"; if all subsequent requests are locked to the same cache_node created by the first request even prior to its completion?

You've previously noted:

> In theory, cache code can be improved (compared to what we
> currently have) to introduce sending of a response being loaded
> into a cache to multiple clients. I.e., stop waiting for a cache
> lock once we've got the response headers, and stream the response
> body being load to all clients waited for it. This should/can
> help when loading large files into a cache, when waiting with
> proxy_cache_lock for a complete response isn't cheap. In
> practice, introducing such a code isn't cheap either, and it's not
> about using other names for temporary files.

Being what I apparently incorrectly understood proxy_cache_lock to actually do.

So if not the above, what does proxy_cache_lock actually do upon receipt of subsequent requests for the same $uri?


On Jul 1, 2014, at 9:20 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:

> Hello!
>
> On Tue, Jul 01, 2014 at 08:44:47AM -0400, Paul Schlie wrote:
>
>> As it appears a downstream response is not cached until first
>> completely read into a temp_file (which for a large file may
>> require 100's if not 1,000's of MB be transferred), there
>> appears to be no "cache node formed" which to "lock" or serve
>> "stale" responses from, and thereby until the first "cache node"
>> is useably created, proxy_cache_lock has nothing to lock
>> requests to?
>>
>> The code does not appear to be forming a "cache node" using the
>> designated cache_key until the requested downstream element has
>> completed transfer as you've noted?
>
> Your reading of the code is incorrect.
>
> A node in shared memory is created on a request start, and this is
> enough for proxy_cache_lock to work. On the request completion,
> the temporary file is placed into the cache directory, and the
> node is updated to reflect that the cache file exists and can be
> used.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

Paul Schlie June 24, 2014 02:52PM

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

Maxim Dounin June 24, 2014 06:38PM

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

Paul Schlie June 24, 2014 07:52PM

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

Maxim Dounin June 24, 2014 08:32PM

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

Paul Schlie June 24, 2014 09:00PM

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

Paul Schlie June 24, 2014 11:00PM

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

Paul Schlie June 30, 2014 08:46PM

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

Paul Schlie June 30, 2014 09:16PM

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

Maxim Dounin June 30, 2014 09:34PM

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

Paul Schlie June 30, 2014 11:12PM

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

Maxim Dounin July 01, 2014 07:04AM

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

Paul Schlie July 01, 2014 08:46AM

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

Maxim Dounin July 01, 2014 09:22AM

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

Paul Schlie July 01, 2014 10:18AM

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

Maxim Dounin July 01, 2014 12:42PM

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

Paul Schlie July 01, 2014 04:14PM

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

Paul Schlie July 01, 2014 05:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready