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

Make Blocking the default WaitStrategy for Async Loggers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-rc1
    • 2.0-rc2
    • Appenders
    • 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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: