Hi,
The first time you do a request Tomcat loads the servlet ( if it isn't
already loaded) and calls init.
To initialize a connection pool takes some time. I feel it too on a PIII
800MHz with 256MB RAM.
You can set the servlet to be loaded automatically on Tomcat's startup with
<load-on-statup>0</load-on-statup> in web.xml
In this case when the first request is made the servlet will be already
initialized.
----- Original Message -----
From: "pedro salazar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 12:01 PM
Subject: creating a instance of a servlet: takes too long!!
> Greetings,
>
> 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? I just initialize some
> properties and a connection pool....
> Well is it possible that my servlet container at any time my may shutdown
my
> servlet to release memory, and another time it will be requested to start
> again and take another time too long to start, correct?
>
> How can I benchmark the time of instantiation of my servlet and the time
of
> my init method?
>
> System configuration:
> -Tomcat 3.2.1
> -JDK 1.3
> -Linux RedHat 6.2 [kernel 2.2.18]
> -PII400Mhz 256Mbytes
>
> thanks.
>
> --
> <psalazar/>
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html