huwh opened a new pull request, #22424:
URL: https://github.com/apache/flink/pull/22424
## What is the purpose of the change
Currently DefaultAllocatedSlotPool#getFreeSlotsInformation always calculates
the taskExecutorUtilization. This causes task schedules to be too slow when
there are lots of slots, such as 20000 slots total. But only the
EvenlySpreadOutLocationPreferenceSlotSelectionStrategy uses this utilization.
## Brief change log
- *Maintain free slots per task executor in DefaultAllocatedSlotPool to
reduce the cost of task executor utilization calculation.*
- *Calculate task executor's utilization only when used*
## Verifying this change
This change is already covered by existing tests.
### benchmark results
#### origin version
```
Benchmark
(jobConfiguration) Mode Cnt Score Error Units
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH ss 6 7963.471 ? 3040.474 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING ss 6 41735.536 ? 13175.253 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH_EVENLY ss 6 9461.976 ? 3823.653 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING_EVENLY ss 6 41957.036 ? 10394.205 ms/op
```
#### Maintain free slots per task executor in DefaultAllocatedSlotPool
```
Benchmark
(jobConfiguration) Mode Cnt Score Error Units
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH ss 6 7039.183 ? 2073.795 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING ss 6 25766.287 ? 7546.104 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH_EVENLY ss 6 7701.995 ? 1154.260 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING_EVENLY ss 6 29273.547 ? 7111.815 ms/op
```
#### Calculate task executor's utilization only when used
```
Benchmark
(jobConfiguration) Mode Cnt Score Error Units
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH ss 6 5157.789 ? 674.883 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING ss 6 14386.616 ? 3058.114 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
BATCH_EVENLY ss 6 8494.799 ? 1747.083 ms/op
RestartStreamingJobBenchmarkExecutor.startSchedulingAndFailover
STREAMING_EVENLY ss 6 33175.847 ? 5706.390 ms/op
```
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
--
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]