This is a general question. Has anybody found a way of relating java threads on a server to specific Lucee apps. We have many lucee apps and are looking for ways of identifying the app that owns high CPU threads quickly.
when you do a thread dump, you see where every currrently running thread is located, the java stacktrace you get also includes the CFML stacktrace, here a simple CFML code snipped to get all threads running. threads.cfm (899 Bytes)
I put a bash script together which lifts the highest CPU java PID, gets that PIDs highest CPU thread and then prints the thread’s stack BUT there is nothing in there to tie that to a specific lucee/tomcat app, that I can see.
I am looking for an open source tool for getting real time information about the running threads, a bit like htop but java specific, to identify which lucee/tomcat app is burning all the CPU and, if possible, what it is currently executing.
We have used Fusion Reactor in the past. It is a great tool but it costs and we have a lot of servers and is overkill for this use case.
By extending my script with jattach and cross referencing with each app dumping threadnames to a file with createObject( ‘java’, ‘java.lang.Thread’ ).currentThread().getName() I may be able to cobble something together . If I get anywhere I will report back.