1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/source4/dsdb
Douglas Bagnall 60620273db dsdb/modules: a module to count attribute searches and results
The dsdb module stack can turn a simple search request into a
complicated tree of sub-queries that include attributes not originally
asked for and excluding those that were. The corresponding replies
might contain unrequested attributes or (for good reasons, according
to some module) hide requested ones. The entire stack is there to
meddle and that is what is does. Except *this* module. It just counts.
To understand dsdb performance it helps to have some idea what
requests and replies are flying too and fro. This module, when
inserted anywhere in the stack, counts the requests and replies
passing through and the attributes they contain. This data is stored
in on-disk tdbs in the private/debug directory.

The module is not loaded by default. To load it you need to patch the
source4/dsdb/samdb/ldb_modules/samba_dsdb.c and put "count_attrs"
somewhere in the module lists in the samba_dsdb_init() function. For
example, to examine the traffic between repl_meta_data and
group_audit_log, you would do something like this around line 316:

          "subtree_delete",
          "repl_meta_data",
  +       "count_attrs",
          "group_audit_log",
          "encrypted_secrets",

and recompile. Samba will then write to a number of tdb files in the
debug directory as requests and replies pass through. A simple script
is included to read these files. Doing this:

./script/attr_count_read st/ad_dc/private/debug/debug/attr_counts_not_found.tdb

will print a table showing how often various attritbutes were
requested but not found (from the point of view of the module).

A more sophisticated version of the script is coming in the next
commit, but this one is included first because in its simplicity it
documents the storage format reasonably well. The tdb keys are
attribute names, and the values are uint32_t in machine native order.

When the module is included in the stack there will be a very small
decrease in performance.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-01 05:32:25 +00:00
..
common s4:dsdb: Use C99 initializer in dsdb util_trusts 2019-04-29 16:04:28 +00:00
dns dns_update: samba_dnsupdate's exit code is not an errno 2019-01-15 07:53:21 +01:00
kcc kcc: Give a better error message when samdb_ntds_objectGUID fails 2019-03-07 03:50:20 +00:00
repl dsdb/repl: we need to replicate the whole schema before we can apply it 2019-04-11 04:17:10 +00:00
samdb dsdb/modules: a module to count attribute searches and results 2019-05-01 05:32:25 +00:00
schema ldb: Add ORDERED_INTEGER to the proto-schema handling 2019-04-08 02:07:23 +00:00
tests/python pytests: try ldap.modify_order with normal user 2019-05-01 05:32:25 +00:00
pydsdb.c Clean up reference used with PyDict_Setxxx 2019-02-07 17:17:46 +01:00
samdb.pc.in
wscript_build build: Remove bld.gen_python_environments() 2019-03-21 04:06:14 +00:00