[Geoserver-devel] Initialization time

Has anyone else notice in the 1.4+ series that the time to make the first WMS or WFS request takes a long time, but afterwards it is speedy again?
After I launch Geoserver, it seems to take a good 5-8 seconds to do a simple WMS request. But after that first request it seems to go quick.
Is this Spring initializing? And if so, is there a way to get it to do that at startup while everything else is loading?

--
Brent Owens
(The Open Planning Project)

Yes i have noticed the same, the same thing happens to me on the ows
branch, so it is a good guess that spring is probably lazily creating
objects in the background.

Perhaps someone can break out a profiler and see where most of the time
in that first request is being spent.

-Justin

Brent Owens wrote:

Has anyone else notice in the 1.4+ series that the time to make the
first WMS or WFS request takes a long time, but afterwards it is speedy
again?
After I launch Geoserver, it seems to take a good 5-8 seconds to do a
simple WMS request. But after that first request it seems to go quick.
Is this Spring initializing? And if so, is there a way to get it to do
that at startup while everything else is loading?

--
Justin Deoliveira
jdeolive@anonymised.com
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Yes i have noticed the same, the same thing happens to me on the ows
branch, so it is a good guess that spring is probably lazily creating
objects in the background.

Perhaps someone can break out a profiler and see where most of the time
in that first request is being spent.

No need for a profiler, just look at the logs after starting geoserver
and doing a wms request as first request:

15015 [CONFIG] org.geotools.factory.FactoryRegistry - Factory implementations for category CoordinateOperationFactory:
   org.geotools.referencing.operation.DefaultCoordinateOperationFactory
   org.geotools.referencing.operation.AuthorityBackedFactory
15031 [CONFIG] org.geotools.factory.FactoryRegistry - Factory implementations for category CoordinateOperationAuthorityFactory:
   org.geotools.referencing.factory.epsg.DefaultFactory
15093 [CONFIG] org.geotools.factory.FactoryRegistry - Factory implementations for category CSFactory:
   org.geotools.referencing.factory.GeotoolsFactory
15343 [CONFIG] org.geotools.factory.FactoryRegistry - Factory implementations for category CRSAuthorityFactory:
   org.geotools.referencing.factory.epsg.DefaultFactory

That is, the damned espg-wkt file gets loaded into memory, that's
what happens :-p

Now, the epsg-wkt dependency was only on wms module, which is an
error because other modules depend on CRS too... I moved the
dependency onto "data", and have DefaultGeoserverCatalog
resolve EPSG:4326 on startup to force the CRS subsystem initialization.

Now the first getmap request takes 0.65 seconds, the second onwards
0.25 seconds for :

http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=topp:states&width=550&height=250&srs=EPSG:4326

(well, that's on my pc, the request without the change took 1.3 seconds, not 5...).
I have forced the StreamingRenderer initialization too, but that did
not make a huge difference.

Running withing a profiler shows the first request takes quite a bit
of time in the Spring FrameworkServlet doGet, and during StreamingRenderer style processing, possibly because of the big amount
of classes loaded.

Can you tell me how it goes for you now?
Cheers
Andrea