G
G
ggagnidze2013-09-06 08:14:13
Nginx
ggagnidze, 2013-09-06 08:14:13

Does nginx over-cache if two users request the same file at the same time?

There is a caching server based on nginx.
If client A applied for a file that was not in the server's cache and at the time of downloading this file client B applied for the same file - will the file be downloaded twice? If yes, is it worth fixing it via proxy_store?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
ggagnidze, 2013-09-06
@ggagnidze

The problem is the increasing load on the disks (and the general brakes against this background). There are still enough places.

V
VBart, 2013-09-06
@VBart

nginx.org/r/proxy_cache_lock/ru

If enabled, only one request at a time will be allowed to populate the new cache entry identified by the proxy_cache_key directive, passing the request to the upstream server. Other requests of the same element will either wait for the response to appear in the cache, or for the release of the lock for this element, during the time specified by the proxy_cache_lock_timeout directive.

S
Stepan, 2013-09-06
@L3n1n

It looks like you can't fix it. There are only two options:
1. More space for caching
2. All who request the file at the time of its download with the first request will wait until the server caches the file and only then give it.
I don't recommend doing this on an SSD. From personal experience, they killed 70% of the life of an SSD on large files.

G
ggagnidze, 2013-09-06
@ggagnidze

Well, the customer decided not to wrap up and refused the proposals (still at the stage of system formation). Said to use what is :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question