3 Replies Latest reply on Jun 5, 2008 9:01 AM by eblom

    JBoss/Java is consuming CPU on Linux

    eblom

      Hi,

      I'm running a management tool using JBoss on a SLES10/Linux server, also an IP-PBX is running on the same machine.
      The problem is when I'm starting the JBoss server it runs with a CPU load of 85-98% and thats to much, it affects the traffic/calls in the IP-PBX (Dropping calls).
      I have the same problem when I'm running the management tool.
      I have testing different settings in the JVM. We have added -n 19 (nice) to lower the priority, it have some affect but not enough.
      When I'm running on a Windows machine then the application only takes about 30 - 50 % of the CPU. What's the problem??
      I have done different testing for 5 - 7 days now; the only thing that I want is to lower the priority. Can it be so hard...
      Can I lower the priority in another way then using nice?

      uname -a
      Linux 2.6.16.46-0.12-default #1 Thu May 17 14:00:09 UTC 2007 i686 i686 i386 GNU/Linux

      Memory 1GB. (The memory is not the problem)

      I have running on a server with 2CPU, then it works better(suprise).

      Running JBoss 4.2.1 and have test with JBoss 4.2.2 and also testing a clean JBoss without our application, same problem..

      /Magnus




        • 1. Re: JBoss/Java is consuming CPU on Linux
          peterj

          I think that the slowdown in Windows is because the NTFS is significantly slower than than ext3, which means that on Windows the app server spends more time waiting for the multitude of jar jar files to load. At least that is my guess. On my dual-boot system at home it takes jbossas 1/2 the time to boot on Linux as it does on Windows.

          Unfortunately, I don't know what you can do to get jbossas to use less cpu time during startup. Other than waiting for the file system to load jars or read xml config files, and waiting on the odd network query (you can browse through the forums to see who has had issues with that), most of the time is spent in purep rocessing as it initializes the boatload of services.

          On a multi-processor system, you could limit jbossas to using only one of the processors. That would leave the other processors available to do other things.

          • 2. Re: JBoss/Java is consuming CPU on Linux
            eblom

            Unfortunately I have the same problem when I'm running our management application e.g. list all extension in the IP-PBX.
            Then it affects the ongoing traffic/calls in the IP-PBX because of the High CPU load. I don't know if it can be the I/O stuff e.g. Network, sockets.
            I have done some "cpu=samples" and it shows a lot of CPU time in the java sockets, but I don't know if it because of it is in the "Wait" state.

            /Magnus

            • 3. Re: JBoss/Java is consuming CPU on Linux
              eblom

              I have tested my application on a previous version of SLES (SLES9) that we have run before, then I can stress the JBoss to almost stop executing.
              The conclusion I have is the new POSIX thread library on SLES10 is not working with the Sun's JVM 1.5 and 1.6.
              Does any one have a solution how to run with an older library? (LD_ASSUME_KERNEL=2.4.1 is not working).