问题:软锁定缓存条目已被底层 Ehcache 过期

发布于 2024-10-10 03:44:15 字数 712 浏览 0 评论 0原文

我收到警告,但我不知道该怎么办。每次更新 bannedIP 时,大约有 80000 个条目将此警告写入 tomcat 中的 catalina.out 日志文件:

WARNING: Cache package.BannedIP Key package.BannedIP#73121 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly   you should consider increasing the cache timeouts and/or capacity limits
Dec 16, 2010 10:00:53 PM net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy handleLockExpiry

ehcache.xml 文件中 BannedIP 的配置:

    <cache name="package.BannedIP"
       maxElementsInMemory="80000"
       eternal="true"
       overflowToDisk="true"
       diskPersistent="true" />

任何帮助将不胜感激。

I'm getting following warning and I have no idea what to do about it. There is about 80000 entries that write this warning into catalina.out log file in tomcat every time the bannedIPs are getting updated:

WARNING: Cache package.BannedIP Key package.BannedIP#73121 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly   you should consider increasing the cache timeouts and/or capacity limits
Dec 16, 2010 10:00:53 PM net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy handleLockExpiry

The configuration for BannedIP in ehcache.xml file:

    <cache name="package.BannedIP"
       maxElementsInMemory="80000"
       eternal="true"
       overflowToDisk="true"
       diskPersistent="true" />

Any help will be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

年华零落成诗 2024-10-17 03:44:15

您是否因此警告而遇到任何性能或可用性问题?如果不是,那么您似乎应该将此警告视为:警告。

否则,解决方案似乎是增加 maxElementsInMemory 的大小,以解决缓存内容与实际使用内容之间的差异。

希望这有帮助。

Are you experiencing any performance or usability problems as a result of this warning? If not then it seems like you should treat this warning as just that: a warning.

Otherwise, it looks like the solution is to increase the size of maxElementsInMemory to account for the difference in what is cached versus what is realistically being used.

Hope this helps.

樱花落人离去 2024-10-17 03:44:15

您是否已确定 package.BannedIP 实际上包含您所期望的内容?

您可以通过编程方式使用统计信息来查看发生了什么。鉴于您在那里的配置位,Ehcache 永远不应该驱逐任何东西(只要您的 BannedIP 实例少于 80k)。

另外,要清楚该消息的含义:您正在更新 BannedIP 实例,但是当提交发生时,Hibernate 为标记此条目而设置的 SoftLock 正在更新过程中,由于某种原因被驱逐...我想知道为什么这些更新需要这么长时间?

另外,虽然我只是大声思考,但是否可能是其他进程(批量更新)使整个缓存区域无效?

Have you yet made sure the package.BannedIP is actually containing what you expect ?

You could programmatically use the Statistics to see what's going on. Given the configuration bit you have there, Ehcache should never evict anything (as long as you have less than 80k BannedIP instances).

Also, to be clear about what that message means: you are in the process of updating a BannedIP instances but, when the commit happens, the SoftLock that Hibernate has put in place to mark this entry has being in the process of being updated, has been evicted for some reason... I wonder why these updates take so long ?

Also, though I'm just thinking out loud, could it be some other process (bulk update) is invalidating the whole cache region ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文