Hello, CollectionPool class resolved the problem (it's an adaptation of ConnectionPool class found on the web). I've noticed that more time elapsed on Getting Collection. Servlet uses different collections, therefore I created a Hastable of CollectionPool class at Init()function.
Latest performance numbers are very good and no wait for first connections: Database connection + Get Collection + Get Document = average 18ms Regards Devrim Ergel ----- Original Message ----- From: "Mark J. Stang" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, June 30, 2002 7:29 PM Subject: Re: First connection to Xindice takes too much time inservlets? > I have seen all kinds of various delays. They are all related to the loading > the DatabaseManager. If you time it, it is the > DatabaseManager.registerDatabase(). > I wrote a simple CollectionPool that is a Singleton to load it one time. If > you > are doing servlets, load at startup and put it into the app session. Also, > each time > you create a collection there is a bit of time. According to Kimbro you can > keep the collections around. Your issue would be whether to share collections > > between sessions. From my experience, start a thread to create the > collections > when ever the client connects and keep them around until the session dies. > > HTH, > > Mark > > Alex McLintock wrote: > > > At 11:54 30/06/02, Devrim Ergel wrote: > > >I'm using Xindice in Tomcat Servlet environement. I logged elapsed time > > >for connection with XML:DB API. The result is ~750ms for first connection. > > >But next connections takes between 20-40ms.I do not use any connection > > >pooling mechanism so every request to servlet try to reconnect to Xindice. > > > > We were discussing something similar in the Cocoon mailing list. > > Apparently Cocoon does not use any Connection Pool for its connections > > to XIndice and there may in fact be a memory leak with opening up new > > connections each time. > > > > However let me make a guess.... > > > > I think the XML:DB protocol is based upon an http connection request and > > response. http 1.0 by does not keep any connection alive between separate > > requests. However I think that http1.1 does. This means that subsequent > > requests may be faster than the first one. > > > > I'm not expert in this but that might give you a few leads to be getting on > > with. > > > > Other possibilities are that there are services in XINdice which only start > > up when they are requested - but that is a big guess. You can test that by > > automatically making a request when you start up the server.... > > > > Alex McLintock > > > > Openweb Analysts Ltd, London: Software For Complex Websites > > http://www.OWAL.co.uk/ > > Free Consultancy for London Companies thinking of Open Source Software. > > -- > Mark J Stang > System Architect > Cybershop Systems > >
