https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42877

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 208521
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208521&action=edit
Benchmark scripts for full-reindex / batch indexing (bug 42881 family)

Clarifying the goal of this work (bug 42881 family): the target is
infrastructure-facing - the time and CPU a FULL REINDEX
(misc/search_tools/rebuild_elasticsearch.pl) and LARGE BATCH re-indexes (batch
record modification, imports; these enqueue index jobs of up to chunk_size =
5000 records) consume. It is not about how quickly a cataloguer sees one edit:
in KTD we measured the edit-to-searchable time through the stock
es_indexer_daemon and it is dominated by job dispatch (roughly one job per
second), so these patches do not change it.

I am attaching a small benchmark package (bug42881-es-indexing-bench.tar.gz,
see README.txt inside) so testers can reproduce the before/after numbers below
and, importantly, verify that the generated Elasticsearch documents are
byte-for-byte identical (SHA-256 over every document) with and without the
patch.

Setup, once, in a KTD with Elasticsearch (stock sample data works; 10,000
generated records give steadier numbers - gen_records.pl + bulkmarcimport.pl,
see README):
  mkdir -p _bench && cp <extracted files> _bench/

Test plan for this bug
1. prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t  (passes; includes
the new "_get_marc_mapping_rules should cache results" subtest)
2. Before/after, with this patch applied on a branch:
     _bench/ab_bench.sh main HEAD
   Expect: "output identical to baseline" = yes at every batch size; DB
statements per record drop by 1 at batch size 1.
3. Confirm the cache is cleared by clear_search_fields_cache (the same contract
as the existing mapping cache): change a search field mapping (Administration >
Search engine configuration), run
   misc/search_tools/rebuild_elasticsearch.pl -d -r -b, and check the new
mapping is used (clear_search_fields_cache clears the rules cache).
4. Optional, full reindex wall-clock: bash _bench/bench_rebuild.sh before /
after (see README).

Our results (10,436 generated records, KTD + ES 9, one core, best of 3
interleaved rounds, spread between rounds 0-7%), decode + mapping, ms per
record:
  batch 1:   24.8 -> 4.7  (5.3x)
  batch 10:   6.6 -> 4.6  (1.45x)
  batch 500:  4.6 -> 4.5  (1.02x)
  full rebuild_elasticsearch.pl: 103.8 s -> 102.6 s (1.01x)

Honest expectation: this patch removes a ~10 ms per-call fixed cost, so it
matters for many small calls (one-record index jobs) and is essentially neutral
for a full reindex, which makes few, large calls. Its value for the
infrastructure goal is in combination with 42878/42879 (together ~1.46x on a
full rebuild, see bug 42881) and for deployments that index many small jobs.
Please check the bulk numbers on your own hardware.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to