Skip to content

feat(search-indexer)!: batch imported extraction at 100 roots - #1081

Open
ddeboer wants to merge 1 commit into
mainfrom
feat/tune-imported-extraction
Open

ddeboer wants to merge 1 commit into
mainfrom
feat/tune-imported-extraction

Conversation

@ddeboer

@ddeboer ddeboer commented Nov 14, 2026

Copy link
Copy Markdown
Member

Fix #1065

Extraction put 10 roots in each CONSTRUCT, whatever the source. On a QLever import, 100 roots per query ran the CreativeWork stage 5.5 times faster. A live endpoint may be shared with other users and fail on big queries (#838), so it keeps 10.

@lde/pipeline

  • StageOptions.batchSize can take one value per source kind: { endpoint, imported }.
  • The pipeline passes each stage RunOptions.source. It is imported when the resolver (or the fallback) imported a dump, and endpoint otherwise.
  • A stage whose sourceFor swaps in another distribution counts as endpoint. A sourceFor that hands back the resolved distribution unchanged keeps its kind; registrySource does that for a file: dataset. A chained child counts as imported, because it reads its parent's output from a store the pipeline serves itself.

@lde/search-pipeline

  • searchStages defaults batchSize to { endpoint: 10, imported: 100 }.
  • searchIndexerPipeline has two new options: tuning (batchSize, maxConcurrency) applies to every type, and tuningByType overrides it per type name. The per-type override is merged field by field. A name the schema doesn't declare throws.
  • With these, per-stage tuning is no longer a reason to compose the pipeline by hand.

@lde/search-indexer

  • Three new variables: EXTRACTION_BATCH_SIZE, EXTRACTION_CONCURRENCY and EXTRACTION_TUNING (JSON, keyed by type name).
  • QLever now starts with --num-simultaneous-queries set to the busiest stage's concurrency, capped at 4. The memory default stays at 4G, which the issue measured to be enough even at -j 8.

@lde/sparql-qlever

  • QleverServerOptions gains num-simultaneous-queries.

Breaking: IndexerConfig has a new required extraction field. Search stages that set no batchSize now batch 100 roots from an imported dump.

To decide:

  • Set values apply everywhere. As agreed, a batch size you set applies to both kinds of source. That includes registry-sourced types, which read the shared registry endpoint. So EXTRACTION_BATCH_SIZE=200 also sends 200-root queries to the registry.
  • Not re-tested. With 100-root batches and -j 4, queries queue at QLever while its 30 s default-query-timeout still runs. The issue's harness ran these sizes without timeouts, but I haven't re-run it.
  • Overlaps with feat(pipeline)!: fetch selector roots in pages of 1000 #1079. That PR's selector pages are independent of this one. Together they give the 7.5× from the issue.

- Let StageOptions.batchSize take a value per source kind (endpoint,
  imported); the pipeline tells each stage which kind it reads
- Default search stages to 100 roots per batch for an imported dump and 10
  for a live endpoint
- Add tuning and tuningByType to searchIndexerPipeline
- Read EXTRACTION_BATCH_SIZE, EXTRACTION_CONCURRENCY and EXTRACTION_TUNING in
  the indexer
- Add num-simultaneous-queries to the QLever server options; the indexer
  sets it to the busiest stage’s concurrency, up to 4

BREAKING CHANGE: IndexerConfig has a required extraction field; a config
built by hand must add one (extraction: { byType: {} } keeps the defaults).
Search stages that set no batchSize now batch 100 roots from an imported
dump; pass batchSize: 10 to keep the old size.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let a deployment tune extraction batch size and QLever concurrency for imported dumps

1 participant