Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-423

Provide a means to inspect queue usage for Async Loggers and Async Appender

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta9
    • 2.0-rc1
    • Appenders, Core
    • None

    Description

      There are scenarios where logging (even asynchronous logging) can become a performance bottleneck for the application; specifically, during a burst of activity the application may produce log events faster than the appender can consume them. If such a burst continues long enough, the queue that is used to pass log events from the producing (application) thread to the consuming (appender) thread may fill up.

      Note that the queues used by AsyncLoggers and by AsyncAppenders are both bounded queues. Once this queue is full, the producer can only add log events at the same speed that the appender can consume them. So from that point the application becomes IO-bound.

      The correct size of the queue is both application and environment dependent. At what rate do events arrive during a burst? How long does a burst continue? How fast can the consumer take events off the queue?

      In order to be able to tune the queue size, users need a way to sample the queue usage: at the time of the snapshot, how many events are in the queue waiting to be processed? (In concurrent scenarios the answer to this question is pretty much always out of date, but it is still useful to help determine a good queue size.)

      Attachments

        1. jconsole1.png
          84 kB
          Remko Popma
        2. jconsole2.png
          77 kB
          Remko Popma

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rpopma Remko Popma
            rpopma Remko Popma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment