tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Wentzel <Michael.Went...@aswethink.com>
Subject RE: creating a instance of a servlet: takes too long!!
Date Fri, 06 Jul 2001 11:09:51 GMT
> why is that my servlet when the first time is invoked, it 
> takes about 30
> seconds or more to start when the servlets that came in tomcat are
> instantaneous? After the servlet container instantiated and 
> initialized my
> servlet, all the following requests are very fast. Is there 
> any advice for
> what we should do and don't do in init() method? 

Well, one option for a solution is set your servlet to load on startup
and have all your initialization done at startup so that these
elements are already initialized before the first request even comes.

> How can I benchmark the time of instantiation of my servlet 
> and the time of
> my init method?

I would just put in some logging code and find out where exactly
the time is being taken up in your servlet(if indeed this is where
it is actually munching clock cycles).

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

Mime
View raw message