-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-30535] Introduce TTL state based benchmarks #83
Conversation
@masteryhx @Myasuka would you please take a look? Many thanks~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this PR, I mainly care about the choose of TTL configuration.
public enum ExpiredTimeOptions { | ||
|
||
/** 5 seconds. */ | ||
Seconds5(5000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the performance/result change if we tune this expired-seconds configuration?
Say if we increase it to 10
seconds, or decrease it to 3
seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that the warm-up will take 10
seconds, 5
seconds is enough for the test to enter the key expiration phase, and it is not too short. I will give a comparison of the results under different configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to manipulate the TtlTimeProvider
to finely control the number of keys eliminated in each iteration. So I customize the TtlTimeProvider
and provide an option for the percentage of keys that expired per iteration. This option will affect the result of test especially in valueGet
. Here's a running test:
# Benchmark: org.apache.flink.state.benchmark.ttl.TtlValueStateBenchmark.valueGet
# Parameters: (backendType = HEAP, expiredOption = ExpirePercent3PerIteration, stateVisibility = NeverReturnExpired, updateType = OnCreateAndWrite)
# Run progress: 0.00% complete, ETA 00:12:00
# Fork: 1 of 3
# Warmup Iteration 1: 2993.246 ops/ms
# Warmup Iteration 2: 3520.954 ops/ms
# Warmup Iteration 3: 3640.884 ops/ms
# Warmup Iteration 4: 3643.386 ops/ms
# Warmup Iteration 5: 3776.677 ops/ms
# Warmup Iteration 6: 3739.375 ops/ms
# Warmup Iteration 7: 3903.434 ops/ms
# Warmup Iteration 8: 3877.286 ops/ms
# Warmup Iteration 9: 3913.663 ops/ms
# Warmup Iteration 10: 4093.471 ops/ms
Iteration 1: 4117.018 ops/ms
Iteration 2: 4255.166 ops/ms
Iteration 3: 4338.564 ops/ms
Iteration 4: 4439.571 ops/ms
Iteration 5: 4603.235 ops/ms
Iteration 6: 4735.039 ops/ms
Iteration 7: 4896.946 ops/ms
Iteration 8: 5153.644 ops/ms
Iteration 9: 5429.196 ops/ms
Iteration 10: 5772.806 ops/ms
As we can see, as the key expires, the test results increase iteration by iteration. I pick 3% for a predefined value, since there are 20 iterations in each test and we cannot let all the keys expire. WDYT? @Myasuka
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea to use expired percent instead of the specific time-to-live. BTW, why choose 3% as the predefined value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 20 iterations in each test, 10 rounds warm-up and 10 rounds testing. If 3% is chosen, the testing will cover 70% down to 40% state size, which is a relatively reasonable value (not so big or small).
src/main/java/org/apache/flink/state/benchmark/ttl/TtlListStateBenchmark.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update, I like the idea of letting the fixed data expire better than a configured TTL seconds. Please take a look at my comments.
src/main/java/org/apache/flink/state/benchmark/ttl/TtlStateBenchmarkBase.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/flink/state/benchmark/ttl/TtlStateBenchmarkBase.java
Outdated
Show resolved
Hide resolved
a7dffc6
to
da8706a
Compare
@Myasuka I fixed a compile error and now it's OK. Maybe this repo needs a more swift CI process validating the compilation. |
@Myasuka Kindly remind~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update, LGTM.
As the title says, This PR introduce TTL state based benchmarks. The newly added tests are basically the same as the previous tests, but have been streamlined because the running time is too long with so many parameters.
I also suggest we disable it in the daily run, or only enable it weekly in jenkins since this is time-consuming.