Vivek1106-04 commented on code in PR #12418: URL: https://github.com/apache/seatunnel/pull/12418#discussion_r4060850435
########## seatunnel-benchmarks/src/main/java/org/apache/seatunnel/benchmark/CheckpointSchedulingBenchmark.java: ########## @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.benchmark; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; +import org.openjdk.jmh.runner.options.VerboseMode; + +import java.util.concurrent.TimeUnit; + +/** + * Measures how long a due checkpoint trigger waits before its scheduling thread runs it. + * + * <p>This is the part of checkpointing that the scheduling model decides. Checkpoint completion + * time, which {@link CheckpointingTimeBenchmark} measures, is dominated by the barrier round-trip + * and is close to blind to how the trigger was scheduled. + * + * <p>The axis that separates scheduling models is the pipeline count. Every {@code + * CheckpointCoordinator} builds its own two-thread pool, so a member running P pipelines carries 2P + * scheduler threads; a shared pool is a fixed width whatever P is. {@code triggerBodyMicros} is a + * parameter rather than a fixed cost because how long a trigger occupies its thread is what decides + * whether a fixed width is wide enough, and that cost is not the same for every deployment. + * + * <p>{@code checkpointIntervalMillis} defaults far below the production default of 300000 so that a + * benchmark iteration of a few seconds sees a realistic number of triggers. + */ +@BenchmarkMode(Mode.SampleTime) +@OutputTimeUnit(TimeUnit.MICROSECONDS) +@Threads(1) +@Fork( + value = 3, + jvmArgsAppend = { + "-Xms2g", Review Comment: Done in `e8a8450b0` - 4g, matching `CheckpointingTimeBenchmark`. ########## seatunnel-benchmarks/README.md: ########## @@ -70,6 +70,36 @@ java -jar seatunnel-benchmarks/target/benchmarks.jar IMapDagStorageBenchmark java -jar seatunnel-benchmarks/target/benchmarks.jar IMapWalStorageBenchmark ``` +## Run the checkpoint scheduling benchmark + +```bash +java -jar seatunnel-benchmarks/target/benchmarks.jar CheckpointSchedulingBenchmark +``` + +`CheckpointSchedulingBenchmark` measures how long a due checkpoint trigger waits before its +scheduling thread runs it, as a distribution. This is separate from +`CheckpointingTimeBenchmark`, which measures checkpoint completion time: completion time is +dominated by the barrier round-trip and is close to blind to how the trigger was scheduled. + +Parameters: + +- `pipelineNum`: pipelines scheduling checkpoints on the member. Each `CheckpointCoordinator` + builds its own two-thread pool, so this also sets the scheduler thread count. +- `checkpointIntervalMillis`: interval of the background trigger load. The default is far below + the production default of 300000 so that a short iteration sees a realistic number of triggers. Review Comment: Reverted in `556de1f92` - README is back to `dev` untouched. I had missed that the benchmark documentation moved to `docs/en/engines/zeta/benchmark.md`; that file is unchanged too. -- 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]
