Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6671975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:27:14+00:00 2026-05-26T03:27:14+00:00

The thundering herd problem occurs in a highly concurrent environment (typically, many users). When

  • 0

The “thundering herd” problem occurs in a highly concurrent environment (typically, many users). When many users make a request to the same piece of data at the same time, and there is a cache miss (the data for the cached element is not present in the cache) the thundering herd problem is triggered.

I couldn’t find an evidence that ehcache-spring-annotations is adressing this problem.

Do I’ve to write a wrapper and use the explicit locking mechanism?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:27:14+00:00Added an answer on May 26, 2026 at 3:27 am

    The short answer to your question is “no”. Cache annotations are intended to be somewhat general-purpose, whereas solutions to problems like “thundering herd” are implementation-specific.

    By your followup comment I’m going to assume you’re using Ehcache as the implementation. The page you referenced that describes the problem offers a couple of solutions, like using BlockingCache as a decorator for the underlying cache. (The fact that they document such solutions implies that Ehcache does not handle the “thundering herd” problem by default.)

    BlockingCache seems like the most direct solution, so I’d start with that. Using BlockingCache programmatically is easy enough, but using it by configuration takes a little more work on your part. You will need to write your own BlockingCacheDecoratorFactory by extending Ehcache’s CacheDecoratorFactory. Once you’ve done that you can configure it in ehcache.xml for any cache that needs it. But do so with care; turning a cache into a BlockingCache needlessly can adversely affect performance.

    Say you wrote your own decorator factory org.stacker.cache.BlockingCacheDecoratorFactory and you’ve got a cache named “adImages” that you want to protect from the “thundering herd” problem. Your new ehcache.xml entry might look like this:

    <cache name="adImages"
               maxElementsInMemory="5000"
               eternal="false"
               timeToIdleSeconds="1800"
               timeToLiveSeconds="3600"
               overflowToDisk="false">
      <cacheDecoratorFactory class="org.stacker.cache.BlockingCacheDecoratorFactory" />
    </cache>
    

    Check the user’s guide at http://ehcache.org/documentation/user-guide/cache-decorators to read about cache decorators in Ehcache. I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know the factoring that needs to be taken into consideration when
Briefly, a manual reset event is a synchronization construct which is either in the
Hoping there are more knowledgeable people around, here I go. The attempts to call
I was thinkering with the specs for a web service and this question popped

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.