Thanks lot for the detailed explanation, I will definitely try this over
the weekend.

-Sudharma


On Thu, Oct 3, 2013 at 7:00 PM, Remko Popma <[email protected]> wrote:

> Even if you configure multiple AsyncLoggers, there will be only one shared
> ring buffer. For AsyncAppender, there will be one ArrayBlockingQueue +
> Thread for every AsyncAppender configured.
>
> The ring buffer used by AsyncLoggers is pre-allocated with
> RingBufferLogEvent objects and with the default size the empty ring buffer
> will take up about 30MB of memory. The number of slots will remain constant
> during the life of the application.  With AsyncAppender the queue is
> unbounded and will keep growing if you are logging events faster than the
> underlying Appender can handle them.
>
> Which is better in terms of throughput? I haven't compared multiple
> AsyncAppenders to multiple AsyncLoggers so I don't know. If you want to
> confirm this you can take a look at the performance test classes
> in org.apache.logging.log4j.core.async.perftest and modify them for the
> scenario you want to test. I would be very interested to hear your results.
>
> Best regards,
> Remko
>
>
> On Thu, Oct 3, 2013 at 8:21 PM, Sudharma Puranik <
> [email protected]> wrote:
>
>> Oh wonderful, So it means to me that the difference is w.r.t the
>> mechanism used which makes the throughput better. So for AsyncLoggers , it
>> uses disruptor which has immense difference in performance compared to the
>> ArrayBlockingQueue.
>>
>> But when I have multiple  AsyncLoggers , that is mutiple logger entries
>> in logger tag, And I have multiple AsyncAppenders , I see that for
>> AsnycLogger only single thread is created but for multiple AsyncAppenders
>> multiple  threads are created so which is better?
>>
>> -Sudharma
>>
>>
>> On Thu, Oct 3, 2013 at 4:20 PM, Remko Popma <[email protected]>wrote:
>>
>>> You're welcome.
>>>
>>> Christian's blog post has more details on the difference:
>>> http://www.javacodegeeks.com/2013/07/log4j-2-performance-close-to-insane.html
>>>
>>> Best regards,
>>> Remko
>>>
>>> Sent from my iPhone
>>>
>>> On 2013/10/03, at 19:41, Sudharma Puranik <[email protected]>
>>> wrote:
>>>
>>> ok, Thanks a lot for your quick reply, I actually wanted to have
>>> asynchronous logging so I had previously done AsyncAppenders then I am
>>> testing AsyncLoggers but frankly I am unable to understand the difference
>>> between these. Can you please provide any blog of yours or any
>>> explanination you have handy?
>>>
>>> Thanks lot for your time
>>>
>>> -Sudharma
>>>
>>>
>>> On Thu, Oct 3, 2013 at 4:06 PM, Remko Popma <[email protected]>wrote:
>>>
>>>> Yes, waiting at that location means that the async logging thread is
>>>> waiting for new work to arrive. Assuming log events are appearing in the
>>>> log file correctly, I don't see any issue.
>>>>
>>>> Best regards,
>>>> Remko
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On 2013/10/03, at 19:28, Sudharma Puranik <[email protected]>
>>>> wrote:
>>>>
>>>> This is the dump log
>>>>
>>>>
>>>> "AsyncLogger-1" daemon prio=6 tid=0x000000000dd3f800 nid=0x3444
>>>> runnable [0x000000000f46f000]
>>>>    java.lang.Thread.State: TIMED_WAITING (parking)
>>>>  at sun.misc.Unsafe.park(Native Method)
>>>> at
>>>> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:349)
>>>>  at
>>>> com.lmax.disruptor.SleepingWaitStrategy.applyWaitMethod(SleepingWaitStrategy.java:66)
>>>> at
>>>> com.lmax.disruptor.SleepingWaitStrategy.waitFor(SleepingWaitStrategy.java:39)
>>>>  at
>>>> com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:55)
>>>> at
>>>> com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:123)
>>>>  at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>  at java.lang.Thread.run(Thread.java:722)
>>>>
>>>> So do you think it is normal??
>>>>
>>>> -Sudharma
>>>>
>>>>
>>>> On Thu, Oct 3, 2013 at 3:49 PM, Remko Popma <[email protected]>wrote:
>>>>
>>>>> If the events are being logged correctly I don't think there is a
>>>>> problem. The async logger thread is either waiting for more work (log
>>>>> events) to arrive from the ring buffer, or it has written to the disk and
>>>>> it is blocked (waiting) for the I/O call to return.
>>>>>
>>>>> Best regards,
>>>>> Remko
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On 2013/10/03, at 19:02, Sudharma Puranik <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Yes I see log messages getting updated.
>>>>>
>>>>>
>>>>> On Thu, Oct 3, 2013 at 2:54 PM, Remko Popma <[email protected]>wrote:
>>>>>
>>>>>> Are you seeing log messages in your log file?
>>>>>>
>>>>>> Sent from my iPhone
>>>>>>
>>>>>> > On 2013/10/03, at 18:21, Sudharma Puranik <
>>>>>> [email protected]> wrote:
>>>>>> >
>>>>>> > Hello,
>>>>>> >
>>>>>> > I have created a complete asyncLogger and have started my
>>>>>> application, While looking at the thread dump I See that the AsyncLogger 
>>>>>> is
>>>>>> always waiting eventhough my logging is continuously happening. Can you
>>>>>> please help me  in understanding If I am doing something wrong. Attached 
>>>>>> is
>>>>>> the dump snap.
>>>>>> >
>>>>>> > <image.png>
>>>>>> >
>>>>>> > Sudharma
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>> For additional commands, e-mail: [email protected]
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

Reply via email to