This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I am loading a cache in 'init' method of servlet. The cache holds various exceptions which are sent to different exception buckets on screen.
Now as the number of exceptions are too high, it takes a long time (around 30 min) to load the cache. Untill the cache is loaded the servlet does not show up. So servlet start up time is causing performance issues.
Is there any way through which first exception cacheing is handled by some script or different method in servlet and then the servlet comes up?
How to reduce the start up time for this servlet, considering amount of cacheing required? Please let me know if any more information is required.
Does the servlet need the cache for its work? If so, I don't see a way around waiting for that time until it can assume operation. If not, I'd move the cache initialization to a ServletContextListener that runs independently of any servlet.
1) attack the load method to see if you can speed it up 2) make the cache load in a separate thread and only make the loaded parts available to the Servlet eg
3) once again load in a separate thread, but allow the SErvlet to load the data it needs too
Note that it is not always a problem if the data gets loaded from both sides. 4) Don't use caching
if you let go of the idea that the cache needs to be 100% before it is useful, you can slowly improve your performance while the cache fills.
Originally posted by Imtiyaz Ahmed: u may get benefitted by using <load-on-startup> tag in DD.
Please use real words when posting to the forums. Abbreviations such as "u" in place of "you" only serve to make your posts more difficult to read and less likely to generate useful responses.
I am not sure how <load-on-startup> tag will benefit me in this case, I am already using it with value as '1', as the concerned servlet should be the first one to get loaded.
The problem is that due to cacheing happening in 'init(servletConfig)' method, load up time is shooting up.
I dont have a fare clue if a perl script can do my job (cacheing) beforehand and I can just use the object wherever required. I am also not definitely aware if using 'init()' method for cacheing will help. Any insights on this?
"The cache holds various exceptions which are sent to different exception buckets on screen."
What data does the cache contains. You might want to do lazy initialization. Load the cache with data which has been used, so you can prevent the loading of huge data when the servlet starts up.
But i am not sure if you need all the data for display or something that sort.
Jaideep Kshirsagar
Greenhorn
Joined: Aug 29, 2007
Posts: 27
posted
0
Hi, This information may be of help -
The cache holds various exceptions which are sent to different exception buckets on screen.
This means that it is a gui to display exceptions occured while processing.
What data does the cache contains.
Cache consists of various hashmaps containing exception objects of various types.
But i am not sure if you need all the data for display or something that sort.
Yes, I would need the entire data for displaying exceptions on screen.