Repository navigation
[FLINK-41061] Reduce sleep frequency of adaptive partition selection benchmark - #120
Conversation
RocMarshal
left a comment
There was a problem hiding this comment.
Could we split this attribute into two for consise semantic :
- additionalCostMillisPerBatch
- recordsOfAdditionalCostMillis
WDYTA?
| @@ -28,6 +28,7 @@ public class SkewableHigherMultiply extends RichMapFunction<Long, Long> { | |||
|
|
|||
| private final int additionalCostMillisPerRecord; | |||
There was a problem hiding this comment.
Thanks @AlexYinHan
Could we split this attribute into two for consise semantic :
- additionalCostMillisPerBatch
- recordsOfAdditionalCostMillis
WDYTA?
There was a problem hiding this comment.
@RocMarshal Good point. I didn't pay much attention to the semantics.
I'm just not sure about the meaning of recordsOfAdditionalCostMillis. Could it be recordsPerBatch? I can then rename recordsSinceSleep to numRecordsForCurrentBatch for consistency.
There was a problem hiding this comment.
Hi, @AlexYinHan
Sorry for my Ambiguous semantics mentioned above:
Yes. Just adding a few minor changes.
private final int additionalCostMillisPerRecord;->private final int additionalCostMillisPerBatch;
The overview changed lines as:
private final int additionalCostMillisPerBatch;
private final int recordsPerBatch;
private int numRecordsForCurrentBatch;
Hope it helps a little.
c927016 to
3208ff7
Compare
RocMarshal
left a comment
There was a problem hiding this comment.
@AlexYinHan Nice work!
LGTM +1.
|
This might need a rebase from |
|
Hi, @AlexYinHan Could you help rebase the latest master branch then re-push it ? |
AI-Contributed/Feature: 0/24 AI-Contributed/UT: 0/0
0975240 to
68c0ae8
Compare
|
Hi, @MartijnVisser @RocMarshal . Thanks for the information. I have rebased the latest master branch. |
Purpose of the change
This PR addresses FLINK-41061.
The adaptive partition benchmark deliberately slows selected downstream subtasks to measure whether adaptive partition selection can reduce the impact of processing skew. Currently, these subtasks sleep for 1 ms on every record, making this benchmark run for hours and keeps failing the daily run.
Brief change log
In
SkewableHigherMultiply.java, sleep for 1 ms every 100 records, rather than every record, using an independent counter in each slow operator instance.Verifying this change
Environment and method
855597a5460630eb8f72510277bfed7c0be0a004(2.4-SNAPSHOT).123532a4a510002f52f2b5dff42541958e0943ac; the modified variant differs only by this PR's sleep-frequency change.The following JMH command was used for the before/after comparison, with
BENCHMARK_CLASSPATHcontaining the compiled harness and its dependencies:The same command was repeated for
(adaptivePartitioner, adaptivePartitionerMaxTraverseSize) = (true, 2)and(true, 6), saving each result separately.(false, 6)was not run locally because the traverse-size setting is unused when adaptive partitioning is disabled.Results
With 1 fork, no warmup and 1 measurement iteration, the average invocation times were:
These are average times per benchmark invocation, calculated from JMH throughput and
@OperationsPerInvocation(150_000), not total JVM process durations or full CI runtimes.As an additional check, the modified variant was run with 1 fork, 1 warmup iteration and 3 measurement iterations, replacing
-wi 0 -i 1with-wi 1 -w 1s -i 3. The per-iteration average invocation times were:All runs completed successfully. The modified benchmark still showed an adaptive-partitioner benefit in these local measurements, while substantially reducing execution time.
Impact and documentation
Was generative AI tooling used to co-author this PR?
Generated-by: [Qoder Sonus]