| Author |
why does My JSPs are taking very long time to load
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
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.
|
Save India From Corruption - Anna Hazare.
|
 |
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2701
|
|
|
There may be something to do with the way that you handle the database. Which component you used to connect with the database?
|
Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
simple JDBC.
|
 |
Rahul Mahindrakar
Ranch Hand
Joined: Jul 28, 2000
Posts: 1831
|
|
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
Joined: Apr 18, 2009
Posts: 2234
|
|
|
yeah , valuable tips .thanks
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
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 dataYou 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
Joined: Jul 28, 2000
Posts: 1831
|
|
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
Joined: Apr 18, 2009
Posts: 2234
|
|
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
Joined: Jun 26, 2002
Posts: 852
|
|
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
|
http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Thank you.
|
 |
 |
|
|
subject: why does My JSPs are taking very long time to load
|
|
|