volcano-sh / volcano

A Cloud Native Batch System (Project under CNCF)
https://volcano.sh
Apache License 2.0
4.25k stars 971 forks source link

[good first issue]It's better to check and skip allocation for job when it is poped #3047

Open lowang-bh opened 1 year ago

lowang-bh commented 1 year ago

Here(line-175), all the former checks is discarded and waste time because allocating for this task will cause queue overused.

We just need to get job's minResource and check whether the queue will be overused. If it will be overused, skiping this job.

https://github.com/volcano-sh/volcano/blob/04a3b1b6b6b3550e292c7d3132fc1fbf3f6932cd/pkg/scheduler/actions/allocate/allocate.go#L170-L179

What would you like to be added:

Add job's minResource check once job is popped (line-143) from queue.

https://github.com/volcano-sh/volcano/blob/04a3b1b6b6b3550e292c7d3132fc1fbf3f6932cd/pkg/scheduler/actions/allocate/allocate.go#L143-L158

Why is this needed:

To save time.

lowang-bh commented 1 year ago

/good first issue /help wanted

srikanth-iyengar commented 1 year ago

/assign

srikanth-iyengar commented 1 year ago

image

Will this work @lowang-bh ?

lowang-bh commented 1 year ago

Will this work @lowang-bh ?

Here it does not work.

srikanth-iyengar commented 1 year ago

Will this work @lowang-bh ?

Here it does not work.

I misunderstood the issue Will correct it Thanks @lowang-bh

srikanth-iyengar commented 1 year ago

Hey @lowang-bh Just wanted to clarify that we can get the jobs MinResource by the GetMinResource function and need to check if this resource less than Queues Capability ?

lowang-bh commented 1 year ago

Just wanted to clarify that we can get the jobs MinResource by the GetMinResource function and need to check if this resource less than Queues Capability ?

Yes, I think so. queue.used + job.min will less than queue.cap

srikanth-iyengar commented 1 year ago

image should I use the TotalRequest or image this GetMinResources ( which states that it returns minimum resource of pod group )

srikanth-iyengar commented 1 year ago

image Will this work @lowang-bh ?

Monokaix commented 6 months ago

How about just break the task loop?

lowang-bh commented 6 months ago

How about just break the task loop?

The mimMember is the least cost to running a job. And job's minResource is correspding to its memMember. If a queue's used + job's mimResource will be overused, then the allocation will be interupted from allocating. So we can put the check forwarding, so that it will save a amount of time on allocating and discarding with a large job.

This feature depend on the job's accurate mimResource calculation as PR #3057, and also has relationship with https://github.com/volcano-sh/volcano/pull/3430