[PATCH] Improve replication test speed by using immediate events

Andrew Bartlett abartlet at samba.org
Fri Jul 21 06:13:58 UTC 2017

I was looking as why my nice, lovingly engineered patches to speed up
the repl_move test, by avoiding fork() and the string2key cost (which
showed up under perf) didn't really help!

So I looked at what the server does on a DsReplicaSync, and noticed
that not only does it wait 1 second just for the heck of it, it will
waste time and events trying to trigger outbound notifications, rather
than getting on with pulling in changes. 

This is what has been making our replication tests so slow, and why the
tests ran so much faster against Windows!

It is just a one-run sample but with this patch, on my laptop, also
including my ccache patches:

TOP 10 slowest tests
samba4.drs.repl_move.python(promoted_dc)(promoted_dc) -> 159
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc) -> 96
samba4.drs.repl_move.python(vampire_dc)(vampire_dc) -> 75
samba4.nbt.winsreplication(ad_dc_ntvfs) -> 70
samba4.drs.samba_tool_drs.python(promoted_dc)(promoted_dc:local) -> 59
samba4.drs.samba_tool_drs.python(vampire_dc)(vampire_dc:local) -> 58
samba4.drs.repl_schema.python(vampire_dc)(vampire_dc) -> 49
samba4.drs.repl_schema.python(vampire_2000_dc)(vampire_2000_dc) -> 47
samba4.krb5.kdc with account ALLOWED permission to replicate to an
RODC(rodc) -> 43
samba4.krb5.kdc with account DENIED permission to replicate to an
RODC(rodc) -> 42

compared with just the ccache patches:

samba4.drs.repl_move.python(promoted_dc)(promoted_dc) -> 453
samba4.drs.repl_move.python(vampire_dc)(vampire_dc) -> 373
samba4.drs.repl_schema.python(vampire_dc)(vampire_dc) -> 188
samba4.drs.repl_schema.python(promoted_dc)(promoted_dc) -> 151
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc) -> 103
samba4.drs.replica_sync.python(promoted_dc)(promoted_dc:local) -> 92
samba4.drs.repl_schema.python(vampire_2000_dc)(vampire_2000_dc) -> 87
samba4.drs.replica_sync.python(vampire_dc)(vampire_dc:local) -> 81
samba4.drs.samba_tool_drs.python(vampire_dc)(vampire_dc:local) -> 81
samba4.drs.samba_tool_drs.python(promoted_dc)(promoted_dc:local) -> 80

Overall time for make test TESTS="repl drs" dropped from 36min to 19min. 

I'll run a private autobuild with these, but in the meantime, please
carefully review!

The whole set is at:



Andrew Bartlett

Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list