3 Replies Latest reply on Jan 3, 2004 3:30 PM by rseg.net

    Entity Beans / Performance

    rseg.net

      Hello,

      I'm relatively new to JBoss and J2EE. I'm evaluating porting a Delphi/CORBA/Oracle application to JBoss. I've started by prototyping existing functionality but have run into some performance issues.

      I have a stateless session bean collaborating with three entity beans to provide a service. I'm using bean managed transactions and explicitly starting transactions from the stateless session bean. I'm using container managed persistence for the entity beans. The first step is to collect a set of financial transactions so I call a find method on the first entity local interface which returns a collection. For each item in the collection I make several calls to other entity beans. Everything works fine but performance is poor and gets dramatically worse as the size of the initial collection grows. With 50 instances returned in the initial step, I can process 4 instances per second. With 1,000 instances return, it takes 30 seconds to process each one.

      What is the best was to see what is going on in JBoss. I'm particularly interested in how often the database is being access and how often ejbs are being written to disk. From the simple logging I put in so far it seems like a lot of time is being spent simply accessing the instances in the collection returned from the initial find method.

      Here is some information about my environment.

      Athlon XP 2400, 1 Gig RAM
      Redhat Linux 9
      PostgreSQL 7.3.2
      Java 1.4.2
      JBoss 3.2.1

      Regards

      Mark

        • 1. Re: Entity Beans / Performance
          ianlinsdell

          If you are using the supplied JBoss Hypersonic database,
          it logs the SQL in the JBoss Hypersonic directory.

          From there you will be able to see why its slow, most likley because its
          submitting multiple SQL where It could have sumbitted one.

          • 2. Re: Entity Beans / Performance
            julien.dubois

            Hi,

            I see you're using JBoss 3.2.1, which was rather broken concerning CMP 2.x (see the Evil JBoss Matrix http://linuxintegrators.com/jbossBlog/), so the first thing you should do is upgrade.
            After that, be sure to set your get*** methods as read only, and tune your strategy for loading EJBs (look up for on-find and on-load strategies).

            HTH,

            • 3. Re: Entity Beans / Performance
              rseg.net

               

              "julien.dubois" wrote:
              Hi,

              I see you're using JBoss 3.2.1, which was rather broken concerning CMP 2.x (see the Evil JBoss Matrix http://linuxintegrators.com/jbossBlog/), so the first thing you should do is upgrade.
              After that, be sure to set your get*** methods as read only, and tune your strategy for loading EJBs (look up for on-find and on-load strategies).

              HTH,


              Thanks for the help. Just upgrading from 3.2.1 to 3.23 solved most of the problem. Now I'm process 10 transaction per second instead of 1 every 30 seconds.