mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
move proxycache configuration directives into slapo-pcache; add references in related man pages
This commit is contained in:
parent
efaad6c616
commit
905c8d580b
@ -281,13 +281,20 @@ These lines map cn, sn, manager, and description to themselves, and
|
|||||||
any other attribute gets "removed" from the object before it is sent
|
any other attribute gets "removed" from the object before it is sent
|
||||||
to the client (or sent up to the LDAP server). This is obviously a
|
to the client (or sent up to the LDAP server). This is obviously a
|
||||||
simplistic example, but you get the point.
|
simplistic example, but you get the point.
|
||||||
|
.SH PROXY CACHE OVERLAY
|
||||||
|
The proxy cache overlay
|
||||||
|
allows caching of LDAP search requests (queries) in a local database.
|
||||||
|
See
|
||||||
|
.BR slapo-pcache (5)
|
||||||
|
for details.
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.TP
|
.TP
|
||||||
ETCDIR/slapd.conf
|
ETCDIR/slapd.conf
|
||||||
default slapd configuration file
|
default slapd configuration file
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR slapd.conf (5),
|
.BR slapd.conf (5),
|
||||||
.BR slapd-meta (5),
|
.BR slapd\-meta (5),
|
||||||
|
.BR slapo\-pcache (5),
|
||||||
.BR slapd (8),
|
.BR slapd (8),
|
||||||
.BR ldap (3).
|
.BR ldap (3).
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
|
@ -741,81 +741,9 @@ with the advantage of saving one rewrite pass ...)
|
|||||||
.SH PROXY CACHE OVERLAY
|
.SH PROXY CACHE OVERLAY
|
||||||
The proxy cache overlay
|
The proxy cache overlay
|
||||||
allows caching of LDAP search requests (queries) in a local database.
|
allows caching of LDAP search requests (queries) in a local database.
|
||||||
For an incoming query, the
|
See
|
||||||
proxy cache determines its corresponding \fBtemplate\fP. If the template was
|
.BR slapo-pcache (5)
|
||||||
specified as cacheable using the \fBproxytemplate\fP directive and the request is
|
for details.
|
||||||
contained in a cached request, it is answered from the proxy cache. Otherwise,
|
|
||||||
the search is performed as usual and cacheable search results are saved in the
|
|
||||||
cache for use in future queries.
|
|
||||||
.LP
|
|
||||||
|
|
||||||
A template is defined by a filter string and an index identifying a set of
|
|
||||||
attributes. The \fBtemplate string\fP for a query can be obtained by
|
|
||||||
removing assertion values from the RFC 2254 representation of its search
|
|
||||||
filter. A query belongs to a template if its template string and set of
|
|
||||||
projected attributes correspond to a cacheable template. Examples of template strings are (mail=), (|(sn=)(cn=)), (&(sn=)(givenName=)).
|
|
||||||
|
|
||||||
.LP
|
|
||||||
The following cache specific directives can be used to configure the proxy
|
|
||||||
cache:
|
|
||||||
.TP
|
|
||||||
.B overlay proxycache
|
|
||||||
This directive adds the proxycache overlay to the current backend. The
|
|
||||||
proxycache overlay may be used with any backend but is intended for use
|
|
||||||
with the
|
|
||||||
.B ldap
|
|
||||||
and
|
|
||||||
.B meta
|
|
||||||
backends.
|
|
||||||
.TP
|
|
||||||
.B proxycache <database> <max_entries> <numattrsets> <entry_limit> <cc_period>
|
|
||||||
The directive enables proxy caching in the current backend and sets general
|
|
||||||
cache parameters. A <database> backend will be used internally to maintain
|
|
||||||
the cached entries. The chosen database will need to be configured as well,
|
|
||||||
as shown below. Cache replacement is invoked when the cache size grows to
|
|
||||||
<max_entries> entries and continues till the cache size drops below this size.
|
|
||||||
<numattrsets> should be equal to the number of following \fBproxyattrset\fP
|
|
||||||
directives. Queries are cached only if they correspond to a cacheable template
|
|
||||||
(specified by the \fBproxytemplate\fP directive) and the number of entries
|
|
||||||
returned is less than <entry_limit>. Consistency check is performed every
|
|
||||||
<cc_period> duration (specified in secs). In each cycle queries with expired
|
|
||||||
"time to live(\fBTTL\fP)" are removed. A sample cache configuration is:
|
|
||||||
.LP
|
|
||||||
.RS
|
|
||||||
proxycache \fBbdb 10000 1 50 100\fP
|
|
||||||
.RE
|
|
||||||
.TP
|
|
||||||
.B proxyattrset <index> <attrs...>
|
|
||||||
Used to associate a set of attributes <attrs..> with an <index>. Each attribute
|
|
||||||
set is associated with an integer from 0 to <numattrsets>-1. These indices are
|
|
||||||
used by the \fBproxytemplate\fP directive to define cacheable templates.
|
|
||||||
|
|
||||||
.TP
|
|
||||||
.B proxytemplate <template_string> <attrset_index> <ttl>
|
|
||||||
Specifies a cacheable template and "time to live" (in sec) <ttl> of queries
|
|
||||||
belonging to the template.
|
|
||||||
|
|
||||||
.LP
|
|
||||||
The following adds a template with filter string (&sn=)(givenName=)) and attributes mail, postaladdress, telephonenumber and a TTL of 1 hour.
|
|
||||||
.LP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
proxyattrset \fB0 mail postaladdress telephonenumber\fP
|
|
||||||
proxytemplate \fB(&(sn=)(givenName=)) 0 3600\fP
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.LP
|
|
||||||
Directives for configuring the underlying database must also be given, as
|
|
||||||
shown here:
|
|
||||||
.LP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
directory /var/tmp/cache
|
|
||||||
cachesize 100
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.LP
|
|
||||||
Any valid directives for the chosen database type may be used.
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.TP
|
.TP
|
||||||
ETCDIR/slapd.conf
|
ETCDIR/slapd.conf
|
||||||
@ -823,6 +751,7 @@ default slapd configuration file
|
|||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR slapd.conf (5),
|
.BR slapd.conf (5),
|
||||||
.BR slapd\-ldap (5),
|
.BR slapd\-ldap (5),
|
||||||
|
.BR slapo\-pcache (5),
|
||||||
.BR slapd (8),
|
.BR slapd (8),
|
||||||
.BR regex (7).
|
.BR regex (7).
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
|
@ -471,6 +471,12 @@ If you need to find all the leaf entries, please use
|
|||||||
\fB(hasSubordinates=FALSE)\fP
|
\fB(hasSubordinates=FALSE)\fP
|
||||||
instead.
|
instead.
|
||||||
.LP
|
.LP
|
||||||
|
.SH PROXY CACHE OVERLAY
|
||||||
|
The proxy cache overlay
|
||||||
|
allows caching of LDAP search requests (queries) in a local database.
|
||||||
|
See
|
||||||
|
.BR slapo-pcache (5)
|
||||||
|
for details.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
There are example SQL modules in the slapd/back-sql/rdbms_depend/
|
There are example SQL modules in the slapd/back-sql/rdbms_depend/
|
||||||
directory in the OpenLDAP source tree.
|
directory in the OpenLDAP source tree.
|
||||||
|
106
doc/man/man5/slapo-pcache.5
Normal file
106
doc/man/man5/slapo-pcache.5
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
.TH SLAPO-PCACHE 5 "RELEASEDATE" "OpenLDAP LDVERSION"
|
||||||
|
.\" Copyright 1998-2004 The OpenLDAP Foundation, All Rights Reserved.
|
||||||
|
.\" Copying restrictions apply. See the COPYRIGHT file.
|
||||||
|
.\" Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
|
||||||
|
.\" $OpenLDAP$
|
||||||
|
.SH NAME
|
||||||
|
slapo-pcache \- proxycache overlay
|
||||||
|
.SH SYNOPSIS
|
||||||
|
ETCDIR/slapd.conf
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B pcache
|
||||||
|
overlay to
|
||||||
|
.BR slapd (8)
|
||||||
|
allows caching of LDAP search requests (queries) in a local database.
|
||||||
|
For an incoming query, the
|
||||||
|
proxy cache determines its corresponding \fBtemplate\fP. If the template
|
||||||
|
was specified as cacheable using the \fBproxytemplate\fP directive
|
||||||
|
and the request is contained in a cached request, it is answered from
|
||||||
|
the proxy cache.
|
||||||
|
Otherwise, the search is performed as usual and cacheable search results
|
||||||
|
are saved in the cache for use in future queries.
|
||||||
|
.LP
|
||||||
|
|
||||||
|
A template is defined by a filter string and an index identifying a set of
|
||||||
|
attributes. The \fBtemplate string\fP for a query can be obtained by
|
||||||
|
removing assertion values from the RFC 2254 representation of its search
|
||||||
|
filter. A query belongs to a template if its template string and set of
|
||||||
|
projected attributes correspond to a cacheable template. Examples of template strings are (mail=), (|(sn=)(cn=)), (&(sn=)(givenName=)).
|
||||||
|
|
||||||
|
.LP
|
||||||
|
The following cache specific directives can be used to configure the proxy
|
||||||
|
cache:
|
||||||
|
.TP
|
||||||
|
.B overlay proxycache
|
||||||
|
This directive adds the proxycache overlay to the current backend. The
|
||||||
|
proxycache overlay may be used with any backend but is intended for use
|
||||||
|
with the
|
||||||
|
.BR ldap ,
|
||||||
|
.BR meta ,
|
||||||
|
and
|
||||||
|
.BR sql
|
||||||
|
backends.
|
||||||
|
.TP
|
||||||
|
.B proxycache <database> <max_entries> <numattrsets> <entry_limit> <cc_period>
|
||||||
|
The directive enables proxy caching in the current backend and sets general
|
||||||
|
cache parameters. A <database> backend will be used internally to maintain
|
||||||
|
the cached entries. The chosen database will need to be configured as well,
|
||||||
|
as shown below. Cache replacement is invoked when the cache size grows to
|
||||||
|
<max_entries> entries and continues till the cache size drops below this size.
|
||||||
|
<numattrsets> should be equal to the number of following \fBproxyattrset\fP
|
||||||
|
directives. Queries are cached only if they correspond to a cacheable template
|
||||||
|
(specified by the \fBproxytemplate\fP directive) and the number of entries
|
||||||
|
returned is less than <entry_limit>. Consistency check is performed every
|
||||||
|
<cc_period> duration (specified in secs). In each cycle queries with expired
|
||||||
|
"time to live(\fBTTL\fP)" are removed. A sample cache configuration is:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
proxycache \fBbdb 10000 1 50 100\fP
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B proxyattrset <index> <attrs...>
|
||||||
|
Used to associate a set of attributes <attrs..> with an <index>. Each attribute
|
||||||
|
set is associated with an integer from 0 to <numattrsets>-1. These indices are
|
||||||
|
used by the \fBproxytemplate\fP directive to define cacheable templates.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B proxytemplate <template_string> <attrset_index> <ttl>
|
||||||
|
Specifies a cacheable template and "time to live" (in sec) <ttl> of queries
|
||||||
|
belonging to the template.
|
||||||
|
|
||||||
|
.LP
|
||||||
|
The following adds a template with filter string (&sn=)(givenName=)) and attributes mail, postaladdress, telephonenumber and a TTL of 1 hour.
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
proxyattrset \fB0 mail postaladdress telephonenumber\fP
|
||||||
|
proxytemplate \fB(&(sn=)(givenName=)) 0 3600\fP
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
Directives for configuring the underlying database must also be given, as
|
||||||
|
shown here:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
directory /var/tmp/cache
|
||||||
|
cachesize 100
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
Any valid directives for the chosen database type may be used.
|
||||||
|
.SH FILES
|
||||||
|
.TP
|
||||||
|
ETCDIR/slapd.conf
|
||||||
|
default slapd configuration file
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR slapd.conf (5),
|
||||||
|
.BR slapd\-ldap (5),
|
||||||
|
.BR slapd\-meta (5),
|
||||||
|
.BR slapd\-sql (5),
|
||||||
|
.BR slapd (8),
|
||||||
|
.BR regex (7).
|
||||||
|
.SH AUTHOR
|
||||||
|
Originally implemented by Apurva Kumar as an extension to back-meta;
|
||||||
|
turned into an overlay by Howard Chu.
|
Loading…
Reference in New Issue
Block a user