Can syslog Performance Be Improved?

Kristopher Johnson picture Kristopher Johnson · Oct 16, 2008 · Viewed 17.3k times · Source

We have an application on Linux that used the syslog mechanism. After a week spent trying to figure out why this application was running slower than expected, we discovered that if we eliminated syslog, and just wrote directly to a log file, performance improved dramatically.

I understand why syslog is slower than direct file writes. But I was wondering: Are there ways to configure syslog to optimize its performance?

Answer

Torsten Marek picture Torsten Marek · Oct 16, 2008

You can configure syslogd (and rsyslog at least) not to sync the log files after a log message by prepending a "-" to the log file path in the configuration file. This speeds up performance at the expense of the danger that log messages could be lost in a crash.