(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) OpenLDAP Software FAQ : (Category) Configuration : (Category) SLAPD Configuration : (Category) Performance Tuning : (Answer) Can I tune logging to improve performance?
Yes. Logging ("debug" messages) is expensive. Though you can disable logging using the --disable-debug flag, it is not recommended. Instead, it is recommend you disable logging only as needed. Otherwise, you'd have to rebuild to reenable logging.

On a heavily loaded LDAP server, you'll want to add the following to your slapd.conf config file:

loglevel 0

This will prevent slapd from using up extra CPU via syslogd. Because syslog uses both a userland process (syslogd) and system calls syslog(3), the performance gained by disabling syslog completely is very noticeable.


You can improve logging performance on some systems by configuring syslog not to sync the file system with every write-- see your man pages for syslogd/syslog.conf. In Linux, you can prepend the log file name with a "-" in syslog.conf. For example, if you are using the default LOCAL4 logging you could try:

   # LDAP logs
   LOCAL4.*                                   -/var/log/ldap

This took SN searches on a PII 450Mhz from 3/sec to 51/sec.

For syslog-ng, add or modify the following line in syslog-ng.conf:
   options { sync(n); };
where n is the number of lines which will be buffered before a write.
[Append to This Answer]
Kurt@OpenLDAP.org, hyc@openldap.org, rhooper@cyberus.ca, green@mail.utexas.edu, openldap@alextasker.net
Previous: (Answer) Can more indexes improve performance?
Next: (Answer) Can I tune the BDB entry cache?
This document is: http://www.openldap.org/faq/index.cgi?file=80
[Search] [Appearance]
This is a Faq-O-Matic 2.721.test.
© Copyright 1998-2013, OpenLDAP Foundation, info@OpenLDAP.org