7 Replies Latest reply on Aug 26, 2007 12:05 AM by mgrouch

    Page takes too long to load

    mgrouch Expert

      It takes 5 seconds to load relatively simple page.
      No DB interaction, just displaying datatable from cache.
      Seam 1.2.1.GA, JBoss 4.2
      The action method invoked is empty.
      How to troubleshoot this problem?

      Thanks

        • 1. Re: Page takes too long to load
          mgrouch Expert

          Here is a timeline of one request

          2007-08-23 19:12:40,160 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase RESTORE_VIEW 1
          2007-08-23 19:12:40,160 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: RESTORE_VIEW 1
          2007-08-23 19:12:40,160 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
          2007-08-23 19:12:40,176 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: RESTORE_VIEW 1
          2007-08-23 19:12:40,222 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase RESTORE_VIEW 1
          2007-08-23 19:12:40,222 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase APPLY_REQUEST_VALUES 2
          2007-08-23 19:12:40,222 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: APPLY_REQUEST_VALUES 2
          2007-08-23 19:12:41,254 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: APPLY_REQUEST_VALUES 2
          2007-08-23 19:12:41,254 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase APPLY_REQUEST_VALUES 2
          2007-08-23 19:12:41,254 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase PROCESS_VALIDATIONS 3
          2007-08-23 19:12:41,254 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: PROCESS_VALIDATIONS 3
          2007-08-23 19:12:41,472 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: PROCESS_VALIDATIONS 3
          2007-08-23 19:12:41,472 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase PROCESS_VALIDATIONS 3
          2007-08-23 19:12:41,472 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase UPDATE_MODEL_VALUES 4
          2007-08-23 19:12:41,472 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: UPDATE_MODEL_VALUES 4
          2007-08-23 19:12:41,551 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: UPDATE_MODEL_VALUES 4
          2007-08-23 19:12:41,551 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase UPDATE_MODEL_VALUES 4
          2007-08-23 19:12:41,551 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase INVOKE_APPLICATION 5
          2007-08-23 19:12:41,551 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: INVOKE_APPLICATION 5
          2007-08-23 19:12:41,566 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: INVOKE_APPLICATION 5
          2007-08-23 19:12:41,566 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: INVOKE_APPLICATION 5
          2007-08-23 19:12:41,582 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase INVOKE_APPLICATION 5
          2007-08-23 19:12:41,582 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process before phase RENDER_RESPONSE 6
          2007-08-23 19:12:41,582 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] before phase: RENDER_RESPONSE 6
          2007-08-23 19:12:41,582 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] beginning transaction prior to phase: RENDER_RESPONSE 6
          2007-08-23 19:12:45,504 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] after phase: RENDER_RESPONSE 6
          2007-08-23 19:12:45,519 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: RENDER_RESPONSE 6
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:4
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:1
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:3
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:2
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:5
          2007-08-23 19:12:45,535 DEBUG [org.jboss.seam.contexts.Contexts] destroying: teamdev.jsf.util.AjaxRequestsPhaseListener:phase_passed:6
          2007-08-23 19:12:45,535 DEBUG [org.ajax4jsf.framework.renderer.AjaxPhaseListener] Process after phase RENDER_RESPONSE 6


          2007-08-23 19:12:46,285 DEBUG [org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter] Parsing html total time 672ms
          2007-08-23 19:12:46,285 DEBUG [org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter] Finished request processing total time 6141ms for uri:


          • 2. Re: Page takes too long to load
            Mark Spritzler Apprentice

            How about lowering your Seam logging level? :) to just show INFO messages. or turn off Seam logging. I know that Seam does a lot of logging and that definitely will slow things down. I have seen the same thing, it kind of amazes me how much. I thought my app was really slow, but I just changed the log level of Seam and it is now extremely fast, even faster than I expected it to be.

            • 3. Re: Page takes too long to load
              Alexander Kosenkov Newbie

              Double-check your *.page.xml
              xmlns and xsi:schemaLocation should be set very carefully.

              For example:

              <page xmlns="http://jboss.com/products/seam/pages"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"


              If xsd for namespace http://jboss.com/products/seam/pages would'n be found in LIBs, then xml-processor will download it from http://jboss.com/products/seam/pages-2.0.xsd, each time!!

              You can check your firewall log

              • 4. Re: Page takes too long to load
                mgrouch Expert

                I've tried turning off DEBUG level. It doesn't make much difference in performance (although my log files are much smaller now).
                I've checked XSDs and that's not the problem too.
                I'm using server side state saving.

                Why APPLY_REQUEST_VALUES takes about 1 sec

                and

                org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter spends ~sec parsing?

                Thanks

                • 5. Re: Page takes too long to load
                  Mikael Andersson Master

                  Have you tried:

                  <filter>
                   <display-name>org.ajax4jsf.FastFilter</display-name>
                   <filter-name>ajax4jsf</filter-name>
                   <filter-class>org.ajax4jsf.FastFilter</filter-class>
                  </filter>
                  


                  From the docs:


                  This filter is based on the Nekko pacer. In this case an output xhtml code isn't strictly verified and it also could cause lot's of errors and corrupt a layout as a result. Though if you sure that your application markup is really strict for this filter, the filter considerably accelerates all AJAX requests processing.

                  http://labs.jboss.com/file-access/default/members/jbossajax4jsf/freezone/docs/devguide/en/html_single/index.html


                  • 6. Re: Page takes too long to load
                    mgrouch Expert

                    Ajax4Jsf FastFilter doesn't work for me. I get this exception:


                    [java] java.lang.NullPointerException
                     [java] at org.ajax4jsf.xml.serializer.ToXHTMLStream.endElement(ToXHTMLStream.java:967)
                     [java] at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
                     [java] at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249)
                     [java] at org.cyberneko.html.filters.Purifier.endElement(Purifier.java:311)
                     [java] at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.HtmlCorrectionFilter.insertEndElement(HtmlCorrectionFilter.java:78)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.HtmlCorrectionFilter$TableHtmlCorrectionState.startElement(HtmlCorrectionFilte
                    r.java:136)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.HtmlCorrectionFilter.startElement(HtmlCorrectionFilter.java:62)
                     [java] at org.cyberneko.html.filters.DefaultFilter.startElement(DefaultFilter.java:179)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.NekkoParser$ViewStateFilter.startElement(NekkoParser.java:327)
                     [java] at org.cyberneko.html.filters.DefaultFilter.startElement(DefaultFilter.java:179)
                     [java] at org.cyberneko.html.filters.NamespaceBinder.startElement(NamespaceBinder.java:286)
                     [java] at org.cyberneko.html.HTMLTagBalancer.callStartElement(HTMLTagBalancer.java:1009)
                     [java] at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:639)
                     [java] at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2407)
                     [java] at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1881)
                     [java] at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
                     [java] at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
                     [java] at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
                     [java] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                     [java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.NekkoParser.parseSAXSource(NekkoParser.java:193)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.nekko.NekkoParser.parseHtml(NekkoParser.java:213)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper.parseContent(FilterServletResponseWrapper.java:613)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:271)
                     [java] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
                     [java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)


                    • 7. Re: Page takes too long to load
                      mgrouch Expert

                      More info about similar performance issue in this JIRA

                      http://jira.jboss.com/jira/browse/RF-726