且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Solr (JVM) 每小时达到峰值

更新时间:2022-05-07 23:28:15

不要相信您的 GC 日志,除非您在选项中包含 -XX:+PrintGCApplicationStoppedTime.即使到那时也怀疑他们.除非您包含此标志,否则有些停顿和部分停顿可能会很长并且不会被报告.例如.我见过偶尔长时间运行的计数循环需要 15 秒才能达到安全点而导致的暂停,在这种情况下,GC 仅报告了 0.08 秒的暂停部分,它实际上做了一些工作.还有很多暂停的原因不被认为是GC"的一部分,因此可以不被 GC 日志标记报告.

Don't believe your GC logs unless you include -XX:+PrintGCApplicationStoppedTime in options. Suspect them even then. There are pauses and parts of pauses that can be very long and go unreported unless you include this flag. E.g. I've seen pauses caused by the occasional long running counted loop taking 15 seconds to reach a safe point, where GC only reported only the .08 seconds part of the pause where it actually did some work. There are also plenty of pauses whose causes that are not considered part of "GC" and can thereby go unreported by GC logging flags.

您可以尝试添加 jHiccup 作为代理来报告观察到的暂停/故障/停顿/打嗝,而不是依赖 JVM 日志的真实性.如果它显示多秒故障,那么您就会知道您的 JVM 正在暂停.如果它显示 JVM 运行顺畅,那么您就知道查看您的其他配置部分.

You can try adding jHiccup as an agent to report on observed pause/glitch/stall/hiccups rather than rely in the honesty of the JVM logs. If it shows multi-sec glitches then you'll know your JVM is pausing. If it shows smooth JVM operation, then you know to look at your other configuration parts.