4 Replies Latest reply on Dec 3, 2008 5:40 PM by Rob Hills

    JBoss AS 4.2.3.GA + Seam 2.1.0.GA - 1 hit = 100% CPU

    Rob Hills Newbie

      We're trying to work out why a single page hit on our application pushes the CPU to 100%.

      Our setup is JBoss AS 4.2.3.GA + Seam 2.1.0.GA. We're using the APR and serving over HTTPS.

      The 100% CPU hit happens with any page that does any "work" (DB lookup + rendering results). It occurs after multiple hits on the same page. It occurs on two dev machines and a staging server.

      The web application feels very slow for a single user, even running off the staging server. I've got to do performance testing at some stage, but there seems little point while it's so sluggish for a single user.

      WRT memory, my dev machine has 2GB of RAM. The JVM config is: -Xms300m -Xmx300m -XX:NewSize=100m -XX:MaxNewSize=100m and profiling IAW http://www.cecmg.de/doc/tagung_2007/agenda07/24-mai/2b3-peter-johnson/index.html suggests that the GC process is running smoothly. On this machine, there is about 800MB RAM free before JBoss startup and our app doesn't seem to consume the 300MB heap (not in short runs anyway).

      I've been through the server optimisation/slimming process detailed at http://www.jboss.org/community/docs/DOC-10217, with minimal impact on this issue. Not that I was surprised as most of the recommendations in that doc appear to be targeted at scaling performance and our problem is with a single user.

      When I profile the classes to try and establish what is causing the CPU hit, 95% of the CPU time vanishes in two APR methods: org.apache.tomcat.jni.Poll.poll and org.apache.tomcat.jni.Socket.accept.

      Almost no CPU time is consumed by our own classes.

      The profiling is done with JProfiler and AFAICT, the CPU time recording is only for the JBoss server, not other apps on this machine (browser etc.). For the record, the DB accessed by this app is on a separate server and all tables are quite small (the largest is 12K rows, most are < a few hundred records).

      I'm not sure what this is telling me. Is this normal behaviour for JBoss serving HTTPS or have we got our server configuration all wrong? Does anyone have any thoughts on where I should look next?