Discussions

Performance and scalability: Slow first time execution. Need to preload?

  1. Slow first time execution. Need to preload? (3 messages)

    Hello all,

    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
    James
  2. 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.
  3. Elapsed Time Analysis[ Go to top ]

    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.

    Regards,

    Virag

    http://www.auptyma.com
  4. JBoss and JMS Tracing and Profiling[ Go to top ]

    Hi James,

    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:
    http://www.jinspired.com/products/jdbinsight/jbosstracing.html
    http://www.jinspired.com/products/jdbinsight/jbossseamtracing.html
    http://www.jinspired.com/products/jdbinsight/downloads/new-in-4.0.html#jms


    Kind regards,

    William Louth
    JXInsight Product Architect
    JInspired

    "J*EE tuning, testing and tracing with JXInsight"
    http://www.jinspired.com