Performance and scalability: Slow first time execution. Need to preload?
- Posted by: James S
- Posted on: November 11 2005 12:05 EST
I have a J2EE app written for Jboss where most of the processing is done within JMS components (via message-drive beans). I've heard user complains saying that first time a particular jms message is processed, processing times are significantly slower (~8 seconds) than subsequent runs (200 milliseconds). I am not sure where exactly the bottleneck could be.
Can anyone please:
1) suggest how to profile the app run to see what part of the code takes long to execute upon first run?
2) give suggestions on pre-loading J2EE components
Thanks a lot
The use of singleton is resource consuming once used for the first time.
Therefore, you could create a "bootstrap" class that can instantiate and initialize all your singletons and objects that are resource consuming.
You can easily create one using a servlet that is initialized one the server is started.
To get an idea of where the time is being spent, you could try Auptyma's Java Application Monitor. Deploy the agent WAR file on your console and monitor the JVM from the JAM Console.
The trial version is free, and it will tell you down to the line number and method where the time is being spent.
For the answer to the first question I would recommend that you try out JXInsight which is the only product on the market that provides distributed tracing and profiling for JBoss and JMS messaging systems.
Our award winning management console and analysis console is a powerful Java based application that does not suffer from poor interactivity typically associated with web based monitor frontends.
Performance Insight articles and product features relevant to your posting:
JXInsight Product Architect
"J*EE tuning, testing and tracing with JXInsight"