Reputation: 1245
I'm having to learn Squid on the fly for a project and have tried to Google this, but not sure how to ask the question so Google can find it. I have a customer that wants to distribute larger amounts of video to multiple clients, but they have a slow WAN. The idea is to have Squid as a reverse proxy and cache to hold the videos on the local networks for faster transfer to the end users and to avoid saturating the WAN.
My question is this. If multiple users try to download a video that Squid has not yet cached, or fully cached, at the same time, what happens? In my particular scenario (insert unnecessary explanation here), this will happen frequently. Is a separate download of the video from the host opened for each request to Squid, or is Squid smart enough to manage it and only have one connection back to the host actually downloading the video?
Upvotes: 4
Views: 1125
Reputation: 30526
This problem is called thundering herd or cache miss storm. It happens with new resources and also on higly used resources's cache invalidation.
For squid used as a reverse Proxy there are some options available to handle this, like the Collapsed Forwarding. The idea is to temporize parallel queries to the same resources, and use only one query fetching the resource on the backend.
Check the link for details, because depending on the squid version you may have to try different configuration tokens and values.
Upvotes: 3