5 Replies Latest reply on Mar 17, 2008 12:04 PM by Peter Johnson

    JBoss and Postgres on 2 machines

    Michal Glowacki Novice

      Hi

      I have performance problem I can't solve myself. I have two servers, quite good. Now, I run JBoss and Postgres on one machine - works fine - but I expect it can be not enough in near future. That's why I try to move JBoss to separate machine - Xeon 3GHZ (2x2 core) with 3.75 GB RAM. But as soon as I do this, and there is any traffic on my site, CPU goes to over 80% making page almost inaccessible. What can cause the problem? I have set datasource correctly, using internal ip, network config is also ok i believe. Maybe I should set something more?

      Thanks in advance for any clues,
      Michal

        • 1. Re: JBoss and Postgres on 2 machines
          Peter Johnson Master

          You did not say which machine goes over 80% cpu usage. Both of them? If so, I suspect that you are missing an index on one of your tables. Examining the database statistics (using a tool such as ptop) should tell you which table is the problem.

          • 2. Re: JBoss and Postgres on 2 machines
            Michal Glowacki Novice

            I'm sorry, it's the machine with jboss, postgres is almost idle. I believe all important indexes have been set already, I have also reduced ejb usage. Earlier I had a problem with "no more connections available", but this is sorted out by replacing ejb with dao in most places. Now this.

            it's really amazing, one machine (4xXeon Dual Core 2,6GHz and 8GB RAM, jboss using only 1,4) can handle jboss and postgres together better, than leaving postgres on this one and moving jboss to 2 Xeon Dual Cores 3GHz with 3,75 GB RAM.

            • 3. Re: JBoss and Postgres on 2 machines
              Peter Johnson Master

              If you have a profiler you can attach it to the jbossas to see what it is doing. Or you could take multiple jvm thread dumps and see what the threads are doing; that will sometime point out code hot spots.

              Also, have you eliminated garbage collection as being the issue? Have you gathered gc data (using -verbose_gc is usually sufficient) and analyzed it?

              • 4. Re: JBoss and Postgres on 2 machines
                Michal Glowacki Novice

                hi, i have taken thread dump when jboss became not responsible (I have used JMeter to simulate stress) and I have plenty of

                13:23:26"http-0.0.0.0-8100-9" daemon prio=6 tid=0x604a1800 nid=0x1db4 in Object.wait() [
                0x5d1cf000..0x5d1cfc98]
                java.lang.Thread.State: WAITING (on object monitor)
                at java.lang.Object.wait(Native Method)
                - waiting on <0x1f9f96a8> (a org.apache.tomcat.util.net.MasterSlaveWorke
                rThread)
                at java.lang.Object.wait(Object.java:485)
                at org.apache.tomcat.util.net.MasterSlaveWorkerThread.await(MasterSlaveW
                orkerThread.java:81)
                - locked <0x1f9f96a8> (a org.apache.tomcat.util.net.MasterSlaveWorkerThr
                ead)
                at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
                kerThread.java:107)
                at java.lang.Thread.run(Thread.java:619)

                Guess I have to use remote debugger to find out why threads start to wait and probably block each other?

                • 5. Re: JBoss and Postgres on 2 machines
                  Peter Johnson Master

                  These threads are expected. They are idle threads waiting for http input to process. There will always be several of these waiting around.

                  What you need to look for is threads that are doing work.