Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As described in FLINK-15959[Add min number of slots configuration to limit total number of slots], currently ResourceManager will only start a a new worker workers when there 's are resource requirements from jobfor submitted jobs and idle workers will be released after timeout. But in certain scenarios, it is necessary to maintain a certain amount of slots resources as soon as ResourceManager is started . And and these slots resources should not release be released even if all slots they are free. Here are some scenarios which can benefit from this proposal:

  1. For session clusters running short lived-jobs like OLAP, we should treat session clusters as a long-running service. Having running workers all the time can greatly improve the service stability and reduce the job's cold-start latency;

  2. For application mode, batch job might be scheduled stage by stage. If the next region requires more resources, it might take more time to pull up required resources. If users

  3. Users
  4. actually know how many resources are needed when running a single job, initialize all workers when cluster starts can speed up

  5. startup
  6. the resource allocation process

  7. Job schedule in topology order, the next operator won't schedule until prior execution slot allocated. The TaskExecutors will start in several batches . In some cases, it might slow down the startup speed

  8. ;

  9. Flink supports FLINK-12122 [Spread out tasks evenly across all available registered TaskManagers], but

  10. it will only effect if all TMs are registered. Starting all TMs
  11. this requires enough registered TaskManagers. For session cluster, all TaskManagers starting at the beginning can thoroughly solve this problem

  12. For session clusters running short lived-jobs, clusters should have workers all the time to reduce job's E2E latency
  13. ; for application mode, min required TaskManagers is allocated with best effort which might also help improve the evenly distribution but not guaranteed solve this;


Public Interfaces

Option nameDefault Value
slotmanager.number-of-slots.min0
slotmanager.min-total-resource.cpuno default value, it can be derived from slotmanager.number-of-slots.min
slotmanager.min-total-resource.memoryno default value, it can be derived from slotmanager.number-of-slots.min

...


Each time when SlotManager needs to reconcile the cluster resources or fulfill job resource requirements, the DefaultResourceAllocationStrategy will check if the minimum resource requirement has been fulfilled. If it is not, DefaultResourceAllocationStrategy will add PendingTaskManagers to the ResourceAllocationResult/ResourceReconcileResult and FineGrainedSlotManager will allocate new worker resources accordingly.

Notice: The minimum resource allocation will be tried in best effort. The unfulfilled request will be retried in the next resource check but will not block slotmanager from allocating resources to submitted jobs.

Resource stability check in SlotManagerConfiguration

...