1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/script
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
..
git-hooks script/git-hooks: add check-trailing-whitespace 2018-04-26 03:54:38 +02:00
attr_count_read dsdb/modules: a module to count attribute searches and results 2019-05-01 05:32:25 +00:00
autobuild.py autobuild: Build also Samba AD with MIT Kerberos 2019-04-25 10:47:16 +00:00
bisect-test.py PY3: change shebang to python3 in script dir 2018-12-14 14:40:20 +01:00
clean-source-tree.sh Improve output of check-clean-tree.sh script 2015-04-15 05:58:19 +02:00
commit_mark.sh script/commit_mark.sh: add the current branch name 2012-06-07 01:18:55 +02:00
compare_cc_results.py PY3: change shebang to python3 in script dir 2018-12-14 14:40:20 +01:00
configure_check_unused.pl
ctdb-import.msg-filter.sh script: add ctdb-import.* scripts 2013-11-13 14:12:51 +01:00
ctdb-import.tree-filter.sh script: add ctdb-import.* scripts 2013-11-13 14:12:51 +01:00
ctdb-import.txt script: add ctdb-import.* scripts 2013-11-13 14:12:51 +01:00
find_python.sh waf: build: Respect --disable-python for third_party modules 2019-04-24 07:32:31 +00:00
findstatic.pl
generate_param.py generate_param.py: Use C99 initializer for last element in param table 2019-01-17 11:35:12 +01:00
identity_cc.sh waf: add a cross-execute program that runs natively 2015-05-20 11:19:11 +02:00
random-sleep.sh random-sleep: add possiblity to override via environment variable 2013-11-13 14:53:45 +01:00
release.sh script/release.sh: fix off by 1 error in announce.${tagname}.mail.txt creation 2017-01-12 15:34:25 +01:00
show_test_time script/show_test_time: attempt py3 compat 2018-11-01 05:08:10 +01:00
show_testsuite_time Print number of slow tests from script rather than wscript. 2014-11-24 13:06:46 +01:00
traffic_learner traffic learner: avoid truncated output files on error 2019-01-08 23:55:32 +01:00
traffic_replay traffic: load dns query from file and write stats to file 2019-05-01 01:10:42 +00:00
traffic_summary.pl traffic_summary: avoid uninitialised variable warning 2017-08-17 04:06:06 +02:00