ArticleslgStudy

science

Thundering herd problem

Thundering herd problem is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Thundering herd problem rather than just read about it. In short: The thundering herd problem is a performance-degrading phenomenon in computer science and computer networking that occurs when a large number of processes or threads are simultaneously awakened, however, only one process is able to respond to the event or access the new resource, causing most other processes to fail and go back to sleep. This unnecessary awakening consumes CPU and other system resources, potentially…

Key takeaways

  • Thundering herd problem belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Thundering herd problem to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Thundering herd problem from memory before moving on to harder problems.

Reference excerpt

The thundering herd problem is a performance-degrading phenomenon in computer science and computer networking that occurs when a large number of processes or threads are simultaneously awakened, however, only one process is able to respond to the event or access the new resource, causing most other processes to fail and go back to sleep. This unnecessary awakening consumes CPU and other system resources, potentially reducing overall performance and slowing the process that succeeds. Processes or threads are typically awakened in response to a specific event or the availability of a resource. When the thundering herd problem occurs while attempting to access a cache, it is often referred to as a cache stampede.

Mitigation The Linux kernel serializes responses for requests to a single file descriptor, so only one thread or process is woken up. For epoll() in version 4.5 of the Linux kernel, the EPOLLEXCLUSIVE flag was added. Thus several epoll sets (different threads or different processes) may wait on the same resource and only one set will be woken up. For certain workloads this flag can give significant processing time reduction. Similarly in Microsoft Windows, I/O completion ports can mitigate the thundering herd problem, as they can be configured such that only one of the threads waiting on the completion port is woken up when an event occurs. In systems that rely on a backoff mechanism (e.g. exponential backoff), the clients will retry failed calls by waiting a specific amount of time between consecutive retries. In order to avoid the thundering herd problem, jitter can be purposefully introduced in order to break the synchronization across the clients, thereby avoiding collisions. In this approach, randomness is added to the wait intervals between retries, so that clients are no longer synchronized.

See also Process management (computing) Lock convoy Sleeping barber problem TCP global synchronization Cache stampede

References

External links A discussion of this observation on Linux Better Retries with Exponential Backoff and Jitter

Worked examples

Example 1 — a first encounter with Thundering herd problem

Start with the simplest possible case. Write down what Thundering herd problem claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Thundering herd problem before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Thundering herd problem ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Thundering herd problem

In research
Thundering herd problem appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Thundering herd problem in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Thundering herd problem is common in secondary-school and first-year university syllabi. It links to neighbouring topics Concurrency control, so understanding it makes those chapters shorter.
In everyday life
Look for Thundering herd problem outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Thundering herd problem” →

How to study Thundering herd problem in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Thundering herd problem means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Thundering herd problem out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Thundering herd problem in simple terms?

The thundering herd problem is a performance-degrading phenomenon in computer science and computer networking that occurs when a large number of processes or threads are simultaneously awakened, however, only one process is able to respond to the event or access the new resource, causing most other…

Why does Thundering herd problem matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Thundering herd problem?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Thundering herd problem.

Tags

  • Concurrency control

Keep exploring