Michiel,

The usefulness or lack thereof of AsyncAppender is not dependent on the OS. The new 
JVMs do file buffering on all platforms. Don't confuse buffering of the file write 
operation with what AsyncAppender does.

File buffering let you write large chunks to disk instead of writing small chunks. The 
AsyncAppender allows you to do logging while some other work thread is blocked, 
typically while doing I/O.

Here is a test that should be more convincing:

for(int n = 0; n < N; n++) {

  for(int i = 0; i < 10; i++)
    log(msg);
 
  sleep(20); // 20 millisecs
}

Set N to some large value like 1000 or higher.

    Cost of logging = total run time - N*20

The cost of logging can be negative, because the actual time slept can be shorter than 
20 msecs.

Measure the difference between logging AsyncAppender+FileAppender versus FileAppender 
only. See what you get. Ceki

At 09:54 13.02.2001 +0100, you wrote:
>Ceki Gülcü <[EMAIL PROTECTED]> wrote:
>
>> Michiel,
>> 
>
>> What kind of testing are you doing? What do you mean by logging gets
>> faster? With respect to what? Cheers, Ceki
>
>A loop with in it one logging statement, and sometimes a delay. It get
>faster per logging then without a delay. That's the idea of
>AsyncAppender, isn't it? But the thing is, it also gets faster per
>logging if I don't use AsyncAppender. With about the same rate. At
>least, that's my provisional result. 
>
>My explanation would be linux file buffering, which makes writing to
>files faster in these case anyway.
>
>My question was if that would be a sensible explanation, and my
>remark, that if I'm right (I'm not sure), that then it does not make
>sense using AsyncAppender, because the OS is doing the same job.
>
> Michiel.
>
>-- 
>Michiel Meeuwissen - NOS internet 
>Mediacentrum kamer 203 - tel. +31 (0)35 6773065
>http://www.mmbase.org  
>http://www.purl.org/NET/mihxil/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

----
Ceki Gülcü           e-mail: [EMAIL PROTECTED] (preferred)
av. de Rumine 5              [EMAIL PROTECTED]
CH-1005 Lausanne          
Switzerland            Tel: ++41 21 351 23 15


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to