DanielLeens opened a new pull request, #13557:
URL: https://github.com/apache/seatunnel/pull/13557

   ### Purpose of this pull request
   
   Yes, I am contributing to Apache SeaTunnel.
   
   Closes #13556
   
   The Elasticsearch sink's `max_batch_size` reference currently says only 
“batch bulk doc max size”. The default is 10 documents per writer. A user 
importing a large batch without setting it explicitly can send many small Bulk 
API requests. Add a concrete configuration example and explain how to size 
batches using representative measurements.
   
   This change updates only the existing English and Chinese option sections. 
It defines the document-count unit, shows `max_batch_size=1000` as a 
measurement starting point, explains payload/memory/concurrent-writer/latency 
tradeoffs, links Elastic's sizing advice, and points to the existing Zeta 
timer-flush section.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes: documentation and configuration guidance. The historical default 
remains **10**; no Java code, runtime behavior, API, dependencies, connector 
registration, checkpoint/delivery semantics, or existing timer-flush example 
using 10000 changes. This PR does not automatically make existing jobs faster 
and does not claim that 1000 is optimal for every workload. The default 
originated in #2330 rather than a recent regression.
   
   ### How was this patch tested?
   
   From the documentation-only worktree, using JDK 11:
   
   ```sh
   mvn -nsu -Dmaven.gitcommitid.skip=true -T 3C -N spotless:apply
   mvn -nsu -Dmaven.gitcommitid.skip=true -T 3C -N -q -DskipTests verify
   git diff --check
   ```
   
   All returned exit code 0. The nonrecursive Maven checks cover the root 
project only; the repository currently disables Markdown formatting in 
Spotless. Markdown fence balance, both local heading anchors, default/source 
agreement, the explicit 1000 example, and preservation of the existing 10000 
example were checked separately. The linked official Elastic page was opened 
successfully. No Java tests were added because no executable behavior changes. 
Connector compilation/unit tests/E2E and the unchanged `seatunnel-engine-ui` 
were not rerun for these two documentation sections.
   
   Real configuration validation reused the unmodified, source-pinned complete 
engines and JAR manifests described below, rather than rebuilding an unchanged 
connector. Besides the six equal-batch and six default-batch million-row runs, 
a SeaTunnel **1001-row job with max_batch_size=1000** passed exact 
reconciliation of all 19 fields, validating the partial final batch. One 
independent Maintainer reviewed the final two-file diff and experiment evidence 
before submission. GitHub CI is a separate gate and is not claimed as passed by 
these checks.
   
   ### Reproduced workload and results
   
   Pinned SeaTunnel dev `ee0fb0d72f67edbcd6caf08360fd354fa68e002f` and DataX 
master `5993b26cda90f3e6a4a2fd2e42843efeb770ab3d`, both complete engines, Java 
11, one writer, 1 GiB maximum heap, the same frozen MySQL source, and an 
existing self-hosted Elasticsearch 8.9.0 target. The engine host has 4 vCPUs 
and 16 GiB RAM and retains its existing background services. Each job writes 
1,000,000 rows with 19 fields. Both tools receive a 100,000-row warmup and 
three alternating measured pairs. Every measured result is reconciled by 
business ID and all 19 values, including explicit NULL versus empty values. 
JVMs are restarted per job; the warmup does not imply same-JVM JIT warmup.
   
   Decimal, date, time, timestamp, and binary use explicitly declared text 
encodings (binary is Base64); other numeric fields are native. Each job uses a 
fresh one-shard, zero-replica fixture index, `refresh_interval=-1`, and 
non-indexed keyword strings. HTTP compression is disabled for both tools. Both 
also use the same private-TCP preconnect guard and a 100ms owned-process socket 
sampler. These index settings isolate a rebuildable ingestion fixture and are 
not production replica recommendations. The target is shared, not exclusive. 
Timing includes engine startup, successful Bulk acknowledgements, and process 
exit; explicit refresh/search and reconciliation occur outside timing. These 
are end-to-end writer pipelines, not a sink-only microbenchmark or a 
full-text/vector/update/delete result.
   
   **Batch option omitted:** DataX uses its source default `batchSize=1024`; 
SeaTunnel uses its source default `max_batch_size=10`. All other compared 
fixture settings remain fixed.
   
   | Pair | DataX seconds | SeaTunnel seconds | DataX / SeaTunnel throughput |
   | --- | --- | --- | --- |
   | 1 | 81.899 | 533.875 | 6.519 |
   | 2 | 82.033 | 513.338 | 6.258 |
   | 3 | 81.974 | 505.450 | 6.166 |
   
   **Explicit equal batch size of 1000:**
   
   | Pair | DataX seconds | SeaTunnel seconds | DataX / SeaTunnel throughput |
   | --- | --- | --- | --- |
   | 1 | 81.926 | 76.905 | 0.939 |
   | 2 | 72.062 | 80.000 | 1.110 |
   | 3 | 71.997 | 78.015 | 1.084 |
   
   The ratio is SeaTunnel elapsed time divided by DataX elapsed time for equal 
row counts. The default-batch profile reproduces a configuration-driven gap in 
all three pairs. The equal-batch profile does not reproduce a >=20% gap. 
Profiles ran in separate phases, so this is not a claim of an exact 
simultaneous before/after speedup. The results motivate sizing guidance; they 
do not establish 1000 as universally optimal or justify changing a historical 
default.
   
   
   ### Check list
   
   * [x] English and Chinese documentation updated together.
   * [x] No new binaries, dependencies, POM changes, options, default changes, 
or incompatible changes.
   * [x] Connector registration and existing examples preserved; only the two 
option-reference sections changed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to