We are using proxy_store to run several mirrors on demand. Our content consists of large files (500 Mb) which --because of the geographic location of our proxies-- may take a while to load from the backend servers.
When several users hit a file that is not mirrored yet at the same time, nginx will start a connection to the backend server for each of these requests. Causing an incremental slowdown as incoming bandwidth is being saturated.
The relevant part of our configuration looks like this:
location @fetch {
internal;
proxy_pass http://backend.server.com;
proxy_set_header Accept-Encoding "";
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_intercept_errors on;
proxy_buffering on;
root /var/cache/nginx/frontend.server.com;
}
Is there any way in which we can make nginx use one connection to the backend per file? (preferably sharing it when several users request it such that all users already get the data as it is coming in...)
regards,
Peter.