Log4j AsyncAppender
We have a high-speed, high-volume application, which is using log4j. Typically we have been using the SyslogAppender, thinking that it's the lightest weight, fastest appender. But we are seeing high CPU utilization from SYSLOG under high volume (because the filter rules in the SYSLOG conf).
We probably want to switch to using a FileAppender. The question is do we want to use this in conjunction with the log4j AsyncAppender to remove any pauses due to flush (force) to disk?
(The application is very latency sensit开发者_如何学运维ive, so we want minimize any latency the appender might add.) Also - I'm not really sure SyslogAppender is really faster the FileAppender, anyway (but that's the way things have been since I started).
Any thoughts on this would be appreciated.
I would definitely use the AsyncAppender.
I've seen a low latency application virtually stop using a standard file appender. Admittedly they were using (OS)VMs on shared hardware and disks so one VM could monopolise the disk IO and bring the others to a halt while trying to log.
You might also look into logging to JMS and other asynchronous strategies.
精彩评论