Thundering herd problem & Cache stampede

Thundering herd problem:

Shreyansh Kumar
1 min readOct 24, 2019

The thundering herd problem occurs when a large number of threads or processes waiting for an event and are in the awake stage ,until that event occurs, but only one process or thread wins the race and can communicate with the acquired event. All processes will compete for resources, possibly freezing the computer, until the herd is calmed down again.

Cache stampede:

A cache stampede occurs only when the large parallel processing system being used as a cache comes under very high load, it is also called dog-piling. However, under very heavy load, when the cached version of that page expires, there may be sufficient concurrency in the server farm that multiple threads of execution will all attempt to render the content of that page simultaneously. Systematically, none of the concurrent servers know that the others are doing the same rendering at the same time. If sufficiently high load is present, this may by itself be enough to bring about congestion collapse of the system via exhausting shared resources. Congestion collapse results in preventing the page from ever being completely re-rendered and re-cached, as every attempt to do so times out. Thus, cache stampede reduces the cache hit rate to zero and keeps the system continuously in congestion collapse as it attempts to regenerate the resource for as long as the load remains very heavy.

--

--

Shreyansh Kumar

I am a software developer by passion and love to solve problems and remove snowflakes from codes. I love to learn new tech stack.