avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Shaw <r...@silveregg.co.jp>
Subject Re: SELECT 1
Date Tue, 22 Jan 2002 09:03:27 GMT
|| > I had written a database pool last year which got around this problem by
||| > keeping track of the last time the connection was released.  Then the
||| > ping was only made if that time was greater than 5 seconds.  This made a
||| > big difference by cutting the pings down to nil when the application is
||| > heavily loaded.  The thinking is that when the queries are spaced close
||| > together, the fact that the previous query was successful gives the same
||| > information as the ping would, so it is not necessary.
||| 
||| I would have thought that pinging the connection when it was idle would be
||| preferable to pinging it just before it was needed (when you have less time
||| to create a new one), and if it is busy then that is the best time to reduce
||| unnecessary traffic.

I think you misunderstood. His pool does exactly what you describe: pings 
when the connection is idle (last use time > 5 seconds ago) and does not
ping when it is busy (last use time < 5 seconds ago). So, no unnecessary
pinging traffic when the connections are busy.

If you or others are interested we can contribute the code.

Ryan

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message