From 4dea61405692069a9c73e488ba717a6f217b959b Mon Sep 17 00:00:00 2001 From: Gavin Henry Date: Thu, 6 Jan 2011 18:02:16 +0000 Subject: [PATCH] ITS#6521 docs: pcache overlay section in admin guide --- doc/guide/admin/overlays.sdf | 67 +++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/doc/guide/admin/overlays.sdf b/doc/guide/admin/overlays.sdf index e52879d7dc..b8ac9ed3d5 100644 --- a/doc/guide/admin/overlays.sdf +++ b/doc/guide/admin/overlays.sdf @@ -724,13 +724,13 @@ design and implementation details. H3: Proxy Cache Configuration The cache configuration specific directives described below must -appear after a {{EX:overlay proxycache}} directive within a -{{EX:"database meta"}} or {{EX:database ldap}} section of +appear after a {{EX:overlay pcache}} directive within a +{{EX:"database meta"}} or {{EX:"database ldap"}} section of the server's {{slapd.conf}}(5) file. H4: Setting cache parameters -> proxyCache +> pcache This directive enables proxy caching and sets general cache parameters. The parameter specifies which underlying database @@ -738,7 +738,7 @@ is to be used to hold cached entries. It should be set to {{EX:bdb}} or {{EX:hdb}}. The parameter specifies the total number of entries which may be held in the cache. The parameter specifies the total number of attribute sets -(as specified by the {{EX:proxyAttrSet}} directive) that may be +(as specified by the {{EX:pcacheAttrset}} directive) that may be defined. The parameter specifies the maximum number of entries in a cacheable query. The specifies the consistency check period (in seconds). In each period, queries with expired @@ -746,16 +746,16 @@ TTLs are removed. H4: Defining attribute sets -> proxyAttrset +> pcacheAttrset Used to associate a set of attributes to an index. Each attribute set is associated with an index number from 0 to -1. -These indices are used by the proxyTemplate directive to define +These indices are used by the pcacheTemplate directive to define cacheable templates. H4: Specifying cacheable templates -> proxyTemplate +> pcacheTemplate Specifies a cacheable template and the "time to live" (in sec) for queries belonging to the template. A template is described by @@ -763,7 +763,7 @@ its prototype filter string and set of required attributes identified by . -H4: Example +H4: Example for slapd.conf An example {{slapd.conf}}(5) database section for a caching server which proxies for the {{EX:"dc=example,dc=com"}} subtree held @@ -773,27 +773,60 @@ at server {{EX:ldap.example.com}}. > suffix "dc=example,dc=com" > rootdn "dc=example,dc=com" > uri ldap://ldap.example.com/ -> overlay proxycache -> proxycache bdb 100000 1 1000 100 -> proxyAttrset 0 mail postaladdress telephonenumber -> proxyTemplate (sn=) 0 3600 -> proxyTemplate (&(sn=)(givenName=)) 0 3600 -> proxyTemplate (&(departmentNumber=)(secretary=*)) 0 3600 +> overlay pcache +> pcache bdb 100000 1 1000 100 +> pcacheAttrset 0 mail postaladdress telephonenumber +> pcacheTemplate (sn=) 0 3600 +> pcacheTemplate (&(sn=)(givenName=)) 0 3600 +> pcacheTemplate (&(departmentNumber=)(secretary=*)) 0 3600 > > cachesize 20 > directory ./testrun/db.2.a > index objectClass eq > index cn,sn,uid,mail pres,eq,sub +H4: Example for slapd-config + +The same example as a LDIF file for back-config for a caching server +which proxies for the {{EX:"dc=example,dc=com"}} subtree held +at server {{EX:ldap.example.com}}. + +> dn: olcDatabase={2}ldap +> objectClass: olcDatabaseConfig +> objectClass: olcLDAPConfig +> olcDatabase: {2}ldap +> olcSuffix: dc=example,dc=com +> olcRootDN: dc=example,dc=com +> olcDbURI: "ldap://ldap.example.com" +> +> dn: olcOverlay={0}pcache +> objectClass: olcOverlayConfig +> objectClass: olcPcacheConfig +> olcOverlay: {0}pcache +> olcPcache: bdb 100000 1 1000 100 +> olcPcacheAttrset: 0 mail postalAddress telephoneNumber +> olcPcacheTemplate: "(sn=)" 0 3600 0 0 0 +> olcPcacheTemplate: "(&(sn=)(givenName=))" 0 3600 0 0 0 +> olcPcacheTemplate: "(&(departmentNumber=)(secretary=))" 0 3600 +> +> dn: olcDatabase={0}hdb +> objectClass: olcHdbConfig +> objectClass: olcPcacheDatabase +> olcDatabase: {0}hdb +> olcDbDirectory: ./testrun/db.2.a +> olcDbCacheSize: 20 +> olcDbIndex: objectClass eq +> olcDbIndex: cn,sn,uid,mail pres,eq,sub + H5: Cacheable Queries A LDAP search query is cacheable when its filter matches one of the -templates as defined in the "proxyTemplate" statements and when it references +templates as defined in the "pcacheTemplate" statements and when it references only the attributes specified in the corresponding attribute set. In the example above the attribute set number 0 defines that only the attributes: {{EX:mail postaladdress telephonenumber}} are cached for the following -proxyTemplates. +pcacheTemplates. H5: Examples: @@ -801,7 +834,7 @@ H5: Examples: > Attrs: mail telephoneNumber is cacheable, because it matches the template {{EX:(&(sn=)(givenName=))}} and its - attributes are contained in proxyAttrset 0. + attributes are contained in pcacheAttrset 0. > Filter: (&(sn=Richard*)(telephoneNumber)) > Attrs: givenName -- 2.39.5