如何验证集群中Hibernate二级缓存的正确操作?
我想知道如何验证 Hibernate 的 L2 缓存是否正确执行。 我有一个应用程序在带有 JBoss Cache 的 JBoss 5 实例集群上运行。 负载测试将回答性能问题。
但是如何确保与集群相关的问题(例如节点之间的缓存失效)正常工作?
I am wondering how to verify that Hibernate's L2 cache performs correctly. I have an application running on a cluster of JBoss 5 instances with JBoss Cache. Load testing would answer the question of performance.
But how to make sure that cluster related issues like the cache invalidation between nodes works like it should be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是通过 JBoss 5 附带的嵌入式控制台检查二级缓存内容,并执行 @Rich Kroll 建议的练习。
您可以通过 JBoss 5 附带的嵌入式控制台查看缓存统计信息。 它将显示已发生的失效数量。
The easiest would be to check the 2nd level cache contents via the embedded console that JBoss 5 comes with and do an exercise like the one @Rich Kroll suggests.
You can have a look at the Cache statistics via the embedded console that JBoss 5 comes with. It'll show the number of invalidations that have happened.
我建议通过 IP 地址请求资源。 在服务器 A 上,您可以执行更新,然后从服务器 B 请求相同的资源。更新时,资源应从集群中的参与服务器中失效,因此服务器 B 上的结果请求应该是(新)更新的资源。
I would suggest requesting resources by IP address. On server A, you can perform an update, and then request that same resource from server B. On update the resource should be invalidated from participating servers in the cluster, so the resulting request on server B should be the (newly) updated resource.