• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why does My JSPs are taking very long time to load

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

i have written so some jsp that will work as window.open .

But why does my jsp take long time to load

My JSp are taking very long time to load (Actually this consists of some combo boxes where the data needs to be filled in from the database itself)

Any suggestions would be helpful.
 
Sheriff
Posts: 7135
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There may be something to do with the way that you handle the database. Which component you used to connect with the database?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
simple JDBC.
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Some things I would look for

1) Precompile jsp ( for first time loading time)
2) put in some Timers in the jsp page and output them in the html to find out which part of the jsp takes time
3) Cache data retreived from the db so that the next time the db is not accessed anymore.

Br
Rahul P. Mahindrakar
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah , valuable tips .thanks
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul Mahindrakar wrote:Hi

Some things I would look for

1) Precompile jsp ( for first time loading time)
2) put in some Timers in the jsp page and output them in the html to find out which part of the jsp takes time
3) Cache data retreived from the db so that the next time the db is not accessed anymore.

Br
Rahul P. Mahindrakar



I would not bother with 3 unless:
  • Your business logic can tolerate the cached data
  • You know it is recovering data from the database that is to blame


  • Look for the obvious stuff first: what is causing the bottleneck? Is the CPU at 100%, or is it doing nothing and (probably) waiting for IO? Is your JVM running out of memory? If you run the same query in another client on the same machine, is it slow too? If you run the database locally is it much quicker? Do you return loads of results from your database? Do you need them all? Have you profiled the query in your database? Does it suggest any indices?

    If nothing jumps out from that, I would profile your application itself, see if there are any hotspots.
     
    Rahul Mahindrakar
    Ranch Hand
    Posts: 1871
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    HI

    We had a similar problem in one of my projects where there was a country dropdown and it was being retrieved .1 million times a day.

    This query started appearing in the Oracle reports causing some embrassment.

    We decided to cache the data for 30 minutes which was always ok.
    ---
    The timers are relevant because they are able to help isolate the problem area on the jsp. I guess you could easily develop a tag library to help you on performance in your project.

    Br
    Rahul P. mahindrakar
     
    Ravi Kiran Va
    Ranch Hand
    Posts: 2234
    Eclipse IDE Firefox Browser Redhat
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Paul ,

    no cpu is not busy .
    No JVM also working fine .
    I think i need to modify the database query . (I will try this)

    If nothing jumps out from that, I would profile your application itself, see if there are any hotspots.



    Can you please tell me how to do this .I am using MyEclipse IDE.
     
    Ranch Hand
    Posts: 862
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    you can use the jamon jdbc proxy driver. It is a wrapper for your jdbc driver that times all queries that you issue and let you view the results. jamon doesn't require you to change your code.

    Here is how it works. http://jamonapi.sourceforge.net/#WhatsNew22
     
    Ravi Kiran Va
    Ranch Hand
    Posts: 2234
    Eclipse IDE Firefox Browser Redhat
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic