Log4j 2
  1. Log4j 2
  2. LOG4J2-574

Make Blocking the default WaitStrategy for Async Loggers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: 2.0-rc2
    • Component/s: Appenders
    • Labels:
      None

      Description

      With Asynchronous Loggers, the wait strategy determines what the consumer thread does when the queue is empty and it is waiting for events. The LMAX Disruptor offers several options, as some specialized apps want to avoid the latency of waking up a blocked thread. These options have different trade-offs, with busy spin on one end of the spectrum and blocking on the other.

      In log4j we only expose a limited set of these options (no busy spin), and originally chose SleepingWait as the default as it seemed to have the best performance in testing.

      It turned out that in some environments the current default of SleepingWaitStrategy may result in excessive CPU usage (LOG4J2-571). To avoid such problems this ticket proposes to change the default wait strategy for Async Loggers to BlockingWaitStrategy.

        Issue Links

          Activity

          Hide
          Remko Popma added a comment -

          Fixed in revision 1580474.

          Show
          Remko Popma added a comment - Fixed in revision 1580474.

            People

            • Assignee:
              Remko Popma
              Reporter:
              Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development