d0d307a
If you have a lot of groups or very large groups, cyrus-imapd login can become
d0d307a
quite slow due to the way cyrus-imapd handles groups. This may become worse
d0d307a
when using nss_ldap or other slow nss backends to resolve groups.
d0d307a
Caching using nscd can increase speed dramatically but unfortunately not for
d0d307a
all functions cyrus-imapd uses. nscd helps speeding up getgrnam() calls but not
d0d307a
getgrent() calls, which are used by cyrus-imapd to get a complete list of all
d0d307a
groups available.
d0d307a
The groupfile patch implements a quick fix to the problem by using a separate
d0d307a
group.cache file to speed up those operations using getgrent() calls.
d0d307a
Calls to getgrnam() are not touched which means that the group.cache
d0d307a
file must be kept in sync with the group source you are using with nss
d0d307a
configured in /etc/nsswitch.conf. If group.cache doesn't exist,
d0d307a
the patch has no effect and cyrus-imapd handles groups through getgrent().
d0d307a
d0d307a
Quick HOWTO:
d0d307a
- configure group lookup in /etc/nsswitch.conf if not already done
d0d307a
- configure name service cache in /etc/nscd.conf               (not mandatory)
d0d307a
- start nscd with "service nscd start"                         (not mandatory)
d0d307a
- configure a service which periodically updates the group.cache file using the
d0d307a
  upd_groupcache script. Either set up a cronjob or use a event in the cyrus
d0d307a
  configuration.
d0d307a
d0d307a
Sample /etc/cyrus.conf event to update the group cache every 10 minutes:
d0d307a
EVENTS {
d0d307a
  # some events removed here ***
d0d307a
  ...........................***
d0d307a
d0d307a
  # this is only necessary if using group cache feature
d0d307a
  groupcache    cmd="upd_groupcache" period=10
d0d307a
}