• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why does My JSPs are taking very long time to load

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • 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.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4328
238
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
simple JDBC.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1868
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
yeah , valuable tips .thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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: 1868
    • Mark post as helpful
    • send pies
    • 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
    • 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.
     
    steve souza
    Ranch Hand
    Posts: 862
    • Mark post as helpful
    • send pies
    • 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
    • Quote
    • Report post to moderator
    Thank you.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic