問題描述
嘗試在 64 位 linux (CentOS) 機器上診斷一些奇怪的 Tomcat (7.0.21
) 和/或 JVM 錯誤.
Trying to diagnose some bizarre Tomcat (7.0.21
) and/or JVM errors on a 64-bit linux (CentOS) machine.
我正在對我們的服務器應用程序進行負載測試,并嘗試使用 100K 消息對其進行處理.啟動 jvisualvm
并一直關注堆.一切看起來都很棒*(見下文),直到我處理了大約 93K 條消息,然后 Tomcat 就死了.在 Tomcat 的 PID 號上運行 ps
以確認它已死.
I'm load testing our server application and tried hitting it with 100K messages. Launched jvisualvm
and kept my eye on the heap the whole time. Everything was looking great* (see below) until I got to about 93K processed messages and then Tomcat just died. Ran a ps
on Tomcat's PID number to confirm it was dead.
直到這次崩潰:
- 負載測試已經運行了大約 90 分鐘;應該很快就完成了,因為我們是 93K/100K)
- CPU 保持在 45% 左右
- 使用的堆大約 2GB(在 GC 之后加上或減去一堆),但堆大小在大約 30 分鐘后從 4GB 增長到
MAX_HEAP
- 類加載/卸載正常循環
- 線程轉儲正常
服務器代碼中沒有任何對 System.exit()
的調用 - 所以我們可以直接排除(是的,我已經仔細檢查了!!!).
Nowhere in the server code are any calls to System.exit()
- so we can rule that right out (and yes I've double-checked!!!).
我不確定這是 Tomcat 崩潰還是 JVM 崩潰(我怎么知道?).即使我知道,我似乎也找不到任何跡象表明出了什么問題:
I'm not sure if this is Tomcat crashing or the JVM (how do I tell?). And even if I did know, I can't seem to find any indication of what went wrong:
- 所有服務器應用程序的日志都停止了,沒有任何錯誤消息(即使我們已將日志記錄普遍設置為 DEBUG 或更高版本)
- Tomcat 的
catalina.out
并尊重localhost_access_*
文件在沒有任何信息的情況下停止
- All of the server app's logs just stop without any ERROR messages (even though we have logging universally set to DEBUG and higher)
- Tomcat's
catalina.out
and respectlocalhost_access_*
files just stop without any info
我聽說可以讓 Tomcat 記錄核心轉儲,但不知道如何做到這一點,并且在線示例沒有多大幫助.
I've heard it is possible to have Tomcat log a coredump when it does but not sure how to do that and online examples aren't helping much.
SO 將如何診斷?我應該采取哪些步驟來開始排除所有可能的因素?
How would SO go about diagnosing this? What steps should I take to start ruling out all of the possible factors?
提前致謝!
推薦答案
抱歉,我不得不刪除 @erickson 的綠色檢查.我終于弄清楚是什么殺死了 Tomcat.
Sorry I had to remove the green check from @erickson. I finally figured out what was killing Tomcat.
似乎未使用 VisualVM 正確配置探查器插件,并試圖在 Tomcat 進程上運行配置文件將其殺死.
It looks like a profiler plugin is not configured correctly with VisualVM and attempting to run a profile on the Tomcat process killed it.
現在調查原因,一旦我知道更多,就會更新這個答案.
Investigating why right now, and will update this answer once I know more.
這篇關于雄貓突然死了的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!