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