One of the cool features with JDK 1.6 is that you can take a thread dump of a running VM. We were intermittently seeing spikes in our production servers and server would become slow for users whenever we saw a spike. we setup a cron job to take threaddump at regular interval and we nailed the issue. Most thread dumps were 300 KB but on was 25 MB and that ringed some bells. Looking at thread dump told use there were 3300 threads executing the same Runnable Task. Further investigation told us that we were using Executors.newCachedThreadPool to create a thread pool in Spring. This would create a new thread if not available for each submitted job. So it created 3300 threads, more CPU was spent on switching thread context than really doing the job. Using Executors.newFixedThreadPool with a size of 15 solved the issue :).
One of the biggest problems I have been trying to solve at our startup is to put our tomcat nodes in HA mode. Right now if a customer comes, he lands on to a node and remains there forever. This has two major issues: 1) We have to overprovision each node with ability to handle worse case capacity. 2) If two or three high profile customers lands on to same node then we need to move them manually. 3) We need to cut over new nodes and we already have over 100+ nodes. Its a pain managing these nodes and I waste lot of my time in chasing node specific issues. I loath when I know I have to chase this env issue. I really hate human intervention as if it were up to me I would just automate thing and just enjoy the fruits of automation and spend quality time on major issues rather than mundane task,call me lazy but thats a good quality. So Finally now I am at a stage where I can put nodes behing HAProxy in QA env. today we were testing the HA config and first problem I immediat...
I would like to know more about thread dump to solve the problem in our application. Our application running in weblogic 8.1 clustered instance.Once applications went to infinite loop and other problems. We tried to take thread dump. But not able to create thread dump for our instance. what could be the reason?
ReplyDeletewell weblogic is a multithreaded application and you should be able to take a thread dump if you plugin in this JSP. What Jvm are you running on? This assumes that you are running jdk1.5 and above
ReplyDelete