We're running on Weblogic. The first request always takes a few
seconds longer than all following requests. Does anyone know why?
We pre-compile our JSPs so it's not JSP compilation time.
These servlets do data access - does it have something to do with the
DB caching data for subsequent requests?
Or is it due to the classloader having to load some classes for the
first time?
Thanks
enrique - 24 May 2005 22:14 GMT
Possibly the database connection being re-used in subsequent requests,
if you have that feature enabled.
Wibble - 25 May 2005 02:08 GMT
Class loaders, JIT compiler, jar files reads, xml configuration
files to parse, db connections, session replication.
> We're running on Weblogic. The first request always takes a few
> seconds longer than all following requests. Does anyone know why?
[quoted text clipped - 8 lines]
>
> Thanks
Antti S. Brax - 25 May 2005 06:49 GMT
marcus.leon@gmail.com wrote in comp.lang.java.programmer:
> We're running on Weblogic. The first request always takes a few
> seconds longer than all following requests. Does anyone know why?
If your servlets are loaded when the first request arrives
instead of being loaded during startup then this behaviour
is quite normal.

Signature
Antti S. Brax Rullalautailu pitää lapset poissa ladulta
http://www.iki.fi/asb/ http://www.cs.helsinki.fi/u/abrax/hlb/
[1385 messages expunged from folder "Spam"]
Ross Bamford - 25 May 2005 11:17 GMT
> We're running on Weblogic. The first request always takes a few
> seconds longer than all following requests. Does anyone know why?
[quoted text clipped - 8 lines]
>
> Thanks
You might find loading the servlets on startup rather than first use (as
is the default I believe). In web.xml:
<servlet>
<!-- etc -->
<load-on-startup>1</load-on-startup>
</servlet>
The number determines the order to load in where you have multiple
servlets.

Signature
[Ross A. Bamford] [ross AT the.website.domain]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + info@the.website.domain