1 2 Previous Next 20 Replies Latest reply on Jan 13, 2008 12:31 PM by xck3001

    Server Performance Problem with 3.1.3 (delays in loading Ric

    mmichalek

      Hey,
      I recently tried to upgrade from 3.1.2 to 3.1.3 and found that after the upgrade, there are 20-30 second delays between page loads. This is all happening in a development environment, and my system is basically idle during these long delays. If I switch back to 3.1.2, the delays are gone.

      It appears that these delays occur when the browser tries to load a Rich Faces style sheet. The delay happens every time a new page is rendered and lasts at least 20 seconds. Here is the firebug trace information (notice the problematic skin.xcss):

      index.seam
      http://localhost:8084/xcenter/index.seam?cid=11
      localhost:8084
      9 KB
      0ms

      eAGLZKr5DAADWQHL
      http://localhost:8084/xcenter/a4j_3_2_0-SNAPSHOTorg/richfaces/skin.xcss/DATB/eAGLZKr5DAADWQHL
      localhost:8084
      45 KB
      21.01s

      xcenter.css
      http://localhost:8084/xcenter/common/xcenter.css
      localhost:8084
      9 KB
      47ms

      a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.AjaxScript
      http://localhost:8084/xcenter/a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.AjaxScript
      localhost:8084
      45 KB
      94ms

      ... and so on. All of the subsequent requests run quickly.

      My environment:
      *Java 1.5.0_12
      *Tomcat 6.0
      *JSF 1.2 (Sun RI 1.2_07-b03-FCS)
      *Seam 2.0.1.CR1
      *Facelets 1.1.14
      *The delay occurs in Firefox 2 and IE 7 just the same. Like I said before, just reverting back to 3.1.2 solves the problem.


      I tried the Jan 3rd 3.2.0 snapshot, but the problem exists in that version as well. I noticed there have been some changes in 3.1.3 for style loading - I don't know if that's related or not. I tried the setting 'org.richfaces.LoadStyleStrategy' to ALL in web.xml, but that didn't make a difference either.

      Thanks advance for any ideas. Let me know if there's other information I can provide.

        • 1. Re: Server Performance Problem with 3.1.3 (delays in loading

          Does JBoss writes something in log during this delay?

          • 2. Re: Server Performance Problem with 3.1.3 (delays in loading
            mmichalek

            Thanks for the response. I don't see any logging activity during the delay (and my CPU is pretty much idle). I turned up logging for Seam, Richfaces and Facelets. Here is a section from my log, let me know if anymore of this would be helpful, or if there's any other info I can get.

            ...
            17:45:48,373 DEBUG org.jboss.seam.core.Events Processing event:org.jboss.seam.postDestroyContext.EVENT
            17:45:48,373 DEBUG org.jboss.seam.contexts.FacesLifecycle <<< End JSF request
            17:45:48,373 DEBUG org.ajax4jsf.webapp.BaseFilter Finished request processing total time 508ms for uri: /xcenter/a4j_3_2_0-SNAPSHOTorg/richfaces/skin.xcss/DATB/eAGLZKr5DAADWQHL
            <long-delay!>
            17:46:09,297 DEBUG org.ajax4jsf.webapp.BaseFilter Filter start request processing at 1/3/08 5:46 PM for uri: /xcenter/a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.AjaxScript
            17:46:09,297 DEBUG org.ajax4jsf.resource.InternetResourceBase Set response http headers for Resource with key [org.ajax4jsf.javascript.AjaxScript]
            17:46:09,297 DEBUG org.ajax4jsf.resource.InternetResourceBase Send content data for Resource with key [org.ajax4jsf.javascript.AjaxScript]
            17:46:09,313 DEBUG org.ajax4jsf.resource.ScriptRenderer Send 44192 bytes to client for JavaScript resource org.ajax4jsf.javascript.AjaxScript
            ...

            • 3. Re: Server Performance Problem with 3.1.3 (delays in loading

              do you use the FireBug? If so, try to turn it off.

              • 4. Re: Server Performance Problem with 3.1.3 (delays in loading
                mmichalek

                Unfortunately the delay still occurs with Firebug disabled. This also happens with IE 7.

                I wonder if this post is related at all?
                http://jboss.com/index.html?module=bb&op=viewtopic&t=126420

                It looks like we're using the same JSF version. I'll trying changing that and see if it makes any difference.

                • 5. Re: Server Performance Problem with 3.1.3 (delays in loading

                  I did not see any relation with that post yet.

                  According to the log, the server spent 508ms for processing css file before it returned back to the browser. Then, the browser did ask nothing during the 21 sec. What it spent this time for? This is a question. If it were javascript, we can guess that some javascript code works slowly. However, it is about css, not js.

                  BWT, do you experience with the same delay browsing http://livedemo.exadel.com/richfaces-demo/welcome.jsf. It also sends the united css.

                  • 6. Re: Server Performance Problem with 3.1.3 (delays in loading
                    pmaho6

                    I have experienced the same problem with 3.1.3 and have had to go back to a snapshot from 12th November. It is always the CSS which is reported as taking 20+seconds to process by Firebug, although the request itself is completed within milliseconds.

                    Peter

                    • 7. Re: Server Performance Problem with 3.1.3 (delays in loading

                      do you have another computer around with FireFox ?

                      • 8. Re: Server Performance Problem with 3.1.3 (delays in loading
                        cdollar393

                        I saw the same behavior after switching to 3.1.3 - Adding this to my web.xml fixed it for me:

                         <context-param>
                         <param-name>org.richfaces.LoadScriptStrategy</param-name>
                         <param-value>ALL</param-value>
                         </context-param>
                         <context-param>
                         <param-name>org.richfaces.LoadStyleStrategy</param-name>
                         <param-value>ALL</param-value>
                         </context-param>
                         <context-param>
                         <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
                         <param-value>false</param-value>
                         </context-param>
                        


                        Chris

                        • 9. Re: Server Performance Problem with 3.1.3 (delays in loading
                          mmichalek

                          Setting the LoadStyleStrategy and LoadScriptStrategy params in web.xml did not help the situation for me.

                          However, I found that I had this setting in Seam's components.xml:

                          <web:ajax4jsf-filter enable-cache="false" />

                          Removing that setting resolved the long delay.

                          Now, with the enable-cache setting removed, if I add:
                          <context-param>
                           <param-name>org.richfaces.LoadStyleStrategy</param-name>
                           <param-value>DEFAULT</param-value>
                           </context-param>
                          

                          ... things still work ok.

                          But if I change this param to:
                          <context-param>
                           <param-name>org.richfaces.LoadStyleStrategy</param-name>
                           <param-value>ALL</param-value>
                           </context-param>
                          


                          ...then, no RichFaces styles load (the pages look the same as with the NONE setting for this param...)

                          So if I ommit the LoadStyleStrategy param or set it to DEFAULT, things are working ok after removing <web:ajax4jsf-filter enable-cache="false" /> from components.xml.

                          • 10. Re: Server Performance Problem with 3.1.3 (delays in loading
                            pmaho6

                            I have tried the application using another computer with Firefox, with exactly the same results.

                            The major difference between the CSS in the different versions is that 3.1.3GA compresses the CSS, despite having org.ajax4jsf.COMPRESS_SCRIPT set to false. Is there another config setting for CSS compression? This seems like the most likely cause (although linking to a static copy of the compressed CSS from the snapshot does not itself cause any slowness).

                            Peter

                            • 11. Re: Server Performance Problem with 3.1.3 (delays in loading
                              pmaho6

                              Ok, the compressed CSS is not the cause. For reference, CSS compression can be switched off using the org.ajax4jsf.COMPRESS_STYLE context parameter.

                              Tracing the request further, I can see that the request completes within a few milliseconds. However, the connection is then kept open for 20 seconds due to keepalive. (inputBuffer.parseRequestLine(); in Tomcat's Http11Processor generates a SocketTimeoutException after 20 seconds). For some reason the browser is not recognising when the request has completed.

                              I have noticed that the content length HTTP header is twice the actual size of response. This could be responsible, as the browser would wait for the other half of the response, which doesn't exist...

                              Peter

                              • 12. Re: Server Performance Problem with 3.1.3 (delays in loading
                                alexsmirnov

                                RichFaces library does not contain any code to compress CSS. Also, there is no content length response header for a generated CSS file ( we set Transfer-Encoding: chunked instead ).
                                Are you have any Script/CSS compressing filter in the application ?

                                • 13. Re: Server Performance Problem with 3.1.3 (delays in loading
                                  pmaho6

                                  So what is framework/impl/src/main/java/orj/ajax4jsf/css/CssCompressor.java then?

                                  Without specifying org.ajax4jsf.COMPRESS_SCRIPT as false, the request:
                                  GET /webmail/faces/a4j_3_1_3.GAorg/richfaces/renderkit/html/css/dragIndicator.xcss/DATB/eAGLZKr5DAADWQHL HTTP/1.1

                                  Returns:

                                  HTTP/1.1 200 OK
                                  Server: Apache-Coyote/1.1
                                  Last-Modified: Mon, 07 Jan 2008 17:18:23 GMT
                                  Cache-control: max-age=0, no-store, no-cache
                                  Pragma: no-cache
                                  Expires: 0
                                  Content-Type: text/css;charset=ISO-8859-1
                                  Content-Length: 2254
                                  Date: Mon, 07 Jan 2008 17:19:26 GMT

                                  .drgind_fly{z-index:1000;top:40;left:40;position:absolute;}.drgind_internal{opacity:.93;filter:alpha(opacity=93);position:absolute;}.drgind_wordcut{padding:0 0 0 3px;width:200px;overflow:hidden;float:left;white-space:nowrap;}.drgind_text{border-top-width:1px;border-top-style:solid;border-bottom-width:2px;
                                  border-bottom-style:solid;border-right-width:2px;border-right-style:solid;}.drgind_marker{border-top-width:1px;border-top-style:solid;border-bottom-width:2px;
                                  border-bottom-style:solid;border-left-width:1px;border-left-style:solid;vertical-align:top;}.drgind_reject .drgind_marker{background-color:#EF6771;border-top-color:#96000B;border-left-color:#96000B;border-bottom-color:#96000B;vertical-align:top;}.drgind_accept .drgind_marker,.drgind_default .drgind_marker{background-color:#9CDC48;border-top-color:#589900;border-left-color:#589900;border-bottom-color:#589900;vertical-align:top;}.drgind_text{
                                  border-top-color:#D4CFC7;border-bottom-color:#D4CFC7;border-right-color:#D4CFC7;background-color:#EDEAE6;color:#000;}.drgind_text_content{color:#000;
                                  font-weight:bold;font-family:Arial,Verdana,sans-serif;font-size:11px;}

                                  (some newlines added for readability)

                                  The actual content length is 1127 - half the value reported. There are no other filters wrapping these requests.

                                  I have actually seem the CSS response with the Transfer-Encoding header, rather than Content-Length, but it is rare (possibly only the first request in a browser session). There may be some kind of race-condition somewhere in Richfaces.

                                  • 14. Re: Server Performance Problem with 3.1.3 (delays in loading

                                    pmaho6, we still cannot reproduce the case. Do you have some clues who to reproduce it?

                                    1 2 Previous Next