logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: JDBCAppender performance
Date Wed, 08 May 2002 17:44:06 GMT
At 10:27 07.05.2002 -0700, you wrote:
>Performance questions---
>   First off, databases are pathetically slow compared to file or memory 
> writes.  If you have a performance critical application avoid a database 
> where-ever possible.  Ironicly, this is true even for database driven 
> applications -- you'll get better performance by reducing database calls.
>   Second, the JDBCAppender falls victim because of this.  The 
> JDBCAppender itself is not slow (I tried writting sql statements to a 
> file instead of call a database and it's plenty fast), but inserts to a 
> db are going to be slow.  The JDBCAppender has a log buffer, which can be 
> used to clump your performance costs (very fast until the buffer is 
> filled, then slow for the inserts, then fast again).

Hmm, looking at the code it seems to me that the execute(String sql) method 
is called
for every LoggingEvent. In turn, execute(String sql) method opens and 
closes a new
connection each time. Given that opening a new connection is slow, this
can't be the desired behavior, can it?


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

View raw message