Netflix Log4J Optimizations Yield Logging at Massive Scale

by Harry Brumleve on Dec 04, 2012 |

Blitz4k, Netflix’ internally optimized version of log4j, has been released to Github. Blitz4j efficiently generates logs within a massively concurrent and heavy traffic environment while consuming fewer resources than other, more traditional logging technologies. It achieves this by overriding sections of log4j’s code where synchronization and deadlocks may occur.

Netflix changes to log4J include:

  1. Removing all critical synchronizations with concurrent data structures.
  2. Providing extreme configurability in terms of in-memory buffer and worker threads
  3. More isolation of application threads from logging threads by replacing the wait-notify model with an executor pool model.
  4. Better handling of log messages during log storms with configurable summary.

Netflix reports that the cost of logging 300-500 lines per second has dropped by at least 75% by using Blitz4j and spikes of processor activity associated with synchronization have disappeared completely. Applications are now able to respond within an acceptable timeframe even during periods of heavy usage and heightened logging.

As their traffic and need for logging per instance increased, Netflix noticed that log4j consumed more and more resources and slowed the very processes it was logging. They were hesitant to move to a different logging technology such as LogBack because of their heavy investment in log4j. They instead chose to override log4j and customize it for non-blocking, asynchronous logging. The log4j framework is largely unchanged; only the areas that affected scalability were altered.

Netflix’s Karthikeyan Ranganathan recognizes that Blitz4j may not be the best choice for projects just getting off the ground. LogBack is a product from the team that delivered log4j that addresses many of the concerns offered by the Netflix team. In this aspect, projects without the investment in the traditional log4j framework or have been built against slf4j should consider using LogBack over Blitz4j. But for companies with a significant investment in log4j, Blitz4j is a valid option to enable logging at internet scale.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

General Feedback
Marketing and all content copyright © 2006-2016 C4Media Inc. hosted at Contegix, the best ISP we've ever worked with.
Privacy policy

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.