Index: core/src/site/xdoc/index.xml =================================================================== --- core/src/site/xdoc/index.xml (revision 1469288) +++ core/src/site/xdoc/index.xml (working copy) @@ -46,6 +46,7 @@
- Log4j 2 requires Java 5 but takes advantage of enhancements in Java 6 to improve performance. + Log4j 2 requires Java 6. Some features require optional dependencies; the documentation for these features specifies the dependencies.
Index: src/site/xdoc/manual/async.xml =================================================================== --- src/site/xdoc/manual/async.xml (revision 1469288) +++ src/site/xdoc/manual/async.xml (working copy) @@ -761,25 +761,101 @@The latency comparison below is done by logging at +
Latency tests are done by logging at less than saturation, measuring how long a call to Logger.log takes to return. After each call to Logger.log, the test waits for 10 microseconds * threadCount before continuing. Each thread logs 5 million messages.
+All the latency measurements below are results of tests run + on Solaris 10 (64bit) with JDK1.7.0_06, 4-core Xeon X5570 dual CPU + @2.93Ghz with hyperthreading switched on (16 virtual cores).
+
Note that this is log-scale, not linear. + The above graph compares the latency distributions of + an asynchronous logger and a Log4j 1.2.17 Async Appender. + This shows the latency of one thread + during a test where 64 threads are logging in parallel. + The test was run once for the async logger and once for the + async appender.
+| + | Average latency | +99% observations + less than | +99.99% + observations less than | +|||
|---|---|---|---|---|---|---|
| + | 1 thread | +64 threads | +1 thread | +64 threads | +1 thread | +64 threads | +
| Log4j2: Loggers all async | +677 | +4,135 | +1,638 | +4,096 | +8,192 | +16,128 | +
| Log4j2: Loggers mixed + sync/async | +648 | +4,873 | +1,228 | +4,096 | +8,192 | +16,384 | +
| Log4j2: Async Appender | +2,423 | +2,117,722 | +4,096 | +67,108,864 | +16,384 | +268,435,456 | +
| Log4j1: Async Appender | +1,562 | +1,781,404 | +4,096 | +109,051,904 | +16,384 | +268,435,456 | +
| Logback: Async Appender | +2,123 | +2,079,020 | +3,276 | +67,108,864 | +14,745 | +268,435,456 | +
-
-
- Note that the scale of the latency comparison graphs is - logarithmic, not linear. - That makes it a bit difficult to see, but the average latency of - asynchronous loggers is half to one third of the latency of - ArrayBlockingQueue-based asynchronous appenders in scenarios - up to 8 threads. With more threads, the average latency of + The latency comparison graph below is also log-scale, + and shows the average latency of asynchronous loggers and + ArrayBlockingQueue-based asynchronous appenders + in scenarios with more and more threads running in parallel. + Up to 8 threads asynchronous appenders have comparable + average latency, two or three times that of asynchronous loggers. + With more threads, the average latency of asynchronous appenders is orders of magnitude larger than asynchronous loggers.
+
Applications interested in low latency often care not only about average latency, but also about worst-case latency. @@ -787,9 +863,9 @@ better when comparing the maximum latency of 99.99% of observations with other logging methods. When increasing the number of threads - the worst case latency of asynchronous loggers remains more or - less the same (around 10-20 microseconds) - where Asynchronous Appenders start experiencing worst-case + the vast majority of latency measurements for asynchronous + loggers stay in the 10-20 microseconds range + where Asynchronous Appenders start experiencing many latency spikes in the 100 millisecond range, a difference of four orders of magnitude.