Java (Solr) 线程转储有多昂贵?
作为一些持续维护的一部分,我们以一分钟的间隔对 JVM 中的所有线程进行定期线程转储。 (例如curl http://localhost:8983/solr/admin/threaddump.jsp
)
无限期地继续这种做法会对性能/其他负面影响是什么?
As part of some ongoing maintenance, we have been taking regular thread dumps for all threads in the JVM at a one minute interval. (E.g. curl http://localhost:8983/solr/admin/threaddump.jsp
)
What are the performance / other negative impacts of continuing this practice indefinitely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,无论应用程序如何,JVM 线程转储都很便宜,影响也很小。另一方面,Jmap -histos 可能会对性能产生很大影响。我从事维护工作,我们做了很多线程转储,从未见过线程转储导致的直接崩溃。
每分钟运行一次转储的唯一问题是信息太多。
您是否将转储附加到单独的文件中?根据我的经验,您必须随着时间的推移查看转储以捕获诸如瞬时锁争用之类的情况。
Generally, JVM thread dumps are cheap, low impacting, regardless of the applications. Jmap -histos on the other hand, can be very performance impacting. I work in maintance, we do a lot of thread dumps, never seen a direct crash caused by thread dumping.
The only problem with running dumps once a minute is too much information.
Are you appending the dump to a separate file? In my experience you have to look at dumps over time to catch things like transient lock contention.