7 Replies Latest reply on Feb 10, 2009 8:40 AM by tszpinda

    Slow home page start

    tszpinda

      Hi guys,


      I've created simple page for the school (http://tiverton-szkola.co.uk) and a lot of users are complaining the it takes ages to load the home page. Looking in the logs I can see why:



      2009-02-07 06:31:29,640 DEBUG [org.ajax4jsf.webapp.BaseFilter] Filter start request processing at 07/02/09 06:31  for uri: /szkola/a4j/g/3_2_2.GA/org/ajax4jsf/framework.pack.js
      2009-02-07 06:31:29,645 DEBUG [org.ajax4jsf.resource.InternetResourceService] Get content from cache for resource /org/ajax4jsf/framework.pack.js
      2009-02-07 06:31:34,242 DEBUG [org.ajax4jsf.webapp.BaseFilter] Finished request processing total time 4602ms for uri: /szkola/a4j/g/3_2_2.GA/org/ajax4jsf/framework.pack.js
      2009-02-07 06:31:34,979 DEBUG [org.ajax4jsf.webapp.BaseFilter] Filter start request processing at 07/02/09 06:31  for uri: /szkola/a4j/g/3_2_2.GA/org/richfaces/ui.pack.js
      2009-02-07 06:31:34,979 DEBUG [org.ajax4jsf.resource.InternetResourceService] Get content from cache for resource /org/richfaces/ui.pack.js
      2009-02-07 06:31:44,566 DEBUG [org.ajax4jsf.webapp.BaseFilter] Finished request processing total time 9587ms for uri: /szkola/a4j/g/3_2_2.GA/org/richfaces/ui.pack.js
      



      So it takes about 15 sec, only to download those two files and on top of that web content in total the page loads within 22 sec. But those times are given for my connection which is about 8Mb. So imagine 0.5Mb or so.


      I'm not sure if anything can be done, have you got any suggestions?


      Thanks in advance
      Tomek

        • 1. Re: Slow home page start
          kukeltje.ronald.jbpm.org

          those 2 files load in 1 sec each from your site to my laptop in The Netherlands. combined they are indeed around 700kB. Your total site loads in 6.1 seconds.


          A lot of delay is caused by the load order. Take a look at the page with e.g. firebug. You can see that a lot of jqeury files load after one another and your image of 275kb also takes over a second.


          hth a little

          • 2. Re: Slow home page start
            tszpinda

            Thanks for your suggestion, just installing the firebug and see what I can find.


            Regards,


            Tomek

            • 3. Re: Slow home page start
              swd847

              The total page size is around 1200kb (as reported by the web developer toolbar extension for firefox), try installing mod_deflate for apache, it will probably reduce the amount of data that has to go over the wire significantly.


              • 4. Re: Slow home page start
                swd847

                Also it looks like your site is not using persistent connections, that could slow things down a little bit.

                • 5. Re: Slow home page start
                  tszpinda

                  Ronald,


                  I've put all .js files into one file and did the same with css, it speeded up by few sec for my connection. Thanks for that.




                  Stuart,


                  As it's my first website and I haven't heard about "mod_deflate", could you tell me how can I switch it on, while I'm using JBoss 4.3.2. I've looked at

                  http://httpd.apache.org/docs/2.0/mod/mod_deflate.html#enable

                  but this didn't help :)


                  And the same with your 2nd suggestion, if you got link which explain this, could you please post it here.


                  Thanks,

                  • 6. Re: Slow home page start
                    swd847

                    mod_deflate allows you to compress content going over the wire, if you are using apache as a front end. You can also do this directly from jboss/tomcat. I have always done it through apache but I do not have any particular reason for this.


                    To do it through jboss:


                    edit $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml and add the compression and compressibleMimeType elements to the HTTP connector, as specified here (I have never acutally tried this, but I assume it will work).


                    if you are using apache as a front end and want to enable compression first install mod_deflate (most apache installs should already have this).
                    Add the following line to your virtualhost directive:



                    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/xhtml text/css text/javascript



                    On my pages this tends to reduce the page size to around 20% of the original size.

                    • 7. Re: Slow home page start
                      tszpinda

                      Blaming it worked! I have used the first way and to me it loads a bit quicker and size has been reduced by about 20% as you said.


                      Thank you!