4 Replies Latest reply on Mar 12, 2003 10:09 AM by blair_hippo_project

    Sporadic sluggish JSP performace

    blair_hippo_project

      I'm having a very peculiar JSP performance issue. I'm not sure if it's necessarily a JBoss issue, but that's my app server, so I figured I'd ask here.

      I'm developing a web app using Jakarta Struts. I have a particular JSP that will, every fourth hit or so, take a good four seconds to load. Note that this is NOT a JSP compilation issue; once it's compiled, 75% of the time it loads in a fraction of a second. It's just that other 25% that's so totally unacceptable.

      To try and pin down just where the slowdown is happening, I inserted "flags" into my JSP to time how long it takes to get from one point to another; all told, I put about 140 flags in there. Now when the page does its "slow load" trick, I can USUALLY see where the code is bogging down; I'll see it takes me 3.9 seconds to get from point 59 to point 60, for instance. However, the place the slowdown happens has not been consistent from one run to the next. In twelve individual "slow" loads, the 4-second delay has never occurred at the same point twice.

      This makes me suspect I'm competing for resources with something, but I can't imagine what that would be; this is the development environment on my desktop, so I'm the only one logged in. And other developers have witnessed the same fundamental behavior on their desktops as well.

      Has anybody run into anything like this before? Anybody have any good idea for how to make this go away? Anybody have any recommendations for what I might investigate next?

      --Pete

        • 1. Re: Sporadic sluggish JSP performace
          joelvogt

          well whats between 59 and 60? What is your app doing, which database etc. Could be a lot of things ;)
          Which version of JBoss is this occuring in? And which servlet container are you using with it?

          • 2. Re: Sporadic sluggish JSP performace
            blair_hippo_project

            > well whats between 59 and 60?

            Well, that's just it; it doesn't matter, because the place where the slowdown occurrs is never the same twice. It may be 59->60, it may be 3->4, it may be 22->23, etc. Which is why I'm casting my eye towards my environment as the culprit. :)

            Database shouldn't matter, either. The slowdown is definitely occurring while the JSP is processing, and the JSP does NOT hit the database directly. (The Action class populating the Form initiates the database hit(s), but that's running smoothly.)

            > Which version of JBoss is this occuring in?

            3.0.4

            > And which servlet container are you using with it?

            I think Jetty, though I'm not 100% certain of that.

            --Pete

            • 3. Re: Sporadic sluggish JSP performace

              upgrade to 3.0.6, it has a significantly more recetn jetty version - perhaps this will help.

              You could also try the 3.2 series, which uses Jasper2.

              Finally you could try in the JBoss/Tomcat package, to see whether the problem is in your webapp or possibly Jetty,

              Jules

              • 4. Bingo
                blair_hippo_project

                I just switched from Jetty to Tomcat 4.1.12, and that did the trick. The app now runs like a scalded cat. now I can get back to just implementing the damn thing and not fretting over performance. :-)

                Thanks for the tip.