The Netflix Tech Blog: Announcing Blitz4j - a scalable logging framework
传统日志Log4j存在同步锁,严重影响性能:
public void callAppenders(LoggingEvent event) { int writes = 0; for(Category c = this; c != null; c=c.parent) { // Protected against simultaneous call to addAppender, removeAppender,...同步锁 synchronized(c) { if(c.aai != null) { writes += c.aai.appendLoopOnAppenders(event); } if(!c.additive) { break; } } }
if(writes == 0) { repository.emitNoAppenderWarning(this); } }
|
Blitz4j 使用一个并发数据结构替代了同步锁。
基于内存的配置。
使用executor pool 替代 wait-notify ,将应用和日志更好地隔离。可配置的更好的日志信息流。
在不影响应用性能情况下,能够动态配置log4j的debug级别。
Automatic conversion of any log4j appender to the asynchronous model statically or at runtime.
通过使用Servo和用Archaius.动态配置实时取样测量性能,。
Blitz4j和log4j两者性能对比:
[该贴被banq于2012-11-23 09:48修改过]
