Welcome! Log In Create A New Profile

Advanced

Prevent cache from storing files multiple times in the proxy_temp dir

October 18, 2014 06:43AM
Our nginx reverse proxy creates a temporary entry in the proxy_temp directory if that file does not yet exists in the cache. So far so good but if the file does not exists and the file will be requested 10 times at the same time it creates 10 temporary files in the proxy_temp and fetches the data 10 times from the proxied server. The result is high write IO and high bandwidth for a single file.

I already tested "proxy_cache_lock on" and played with the directive "proxy_cache_lock_timeout" which addresses the issue. The disadvantage is that 1 connection will get the data but 9 are delayed because of the lock. The optimal solution would be if all the 10 hypothetic connections will be served from the same temporary cache file out of the proxy_temp.

Is there a good/better approach to solve this scenario?

TIA
Subject Author Posted

Prevent cache from storing files multiple times in the proxy_temp dir

martinproinity October 18, 2014 06:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready