lablup / lablup/backend.ai

Option to use the average utilization for idle checker

Open
#6,092 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Motivation

If we set CPU utilization as the criteria for the idle checker, it takes the **_sum_** of utilization values from all CPU cores and compares it with the configured threshold.

Potentially this makes it eaiser to stay above the threshold as the number of CPU cores increases, hindering the purpose of the idle checker.

Let’s add an option to change the idle-checker metric to use the average utilization per device.

## Required Features

- Add an option to the idle checker criteria to switch between: absolute sum (current impl.) / average
- Required work: Manager API update + Control Panel UI update
- Implement the average-based utilization comparison

## Impact

- The existing setups will keep the existing behavior unless the new option is explicitly set.
- We could guide the customers about the new option.

## Testing Scenarios

- Run an artificial CPU consumption work (with appropriate combination of sleep and spinning) to simulate CPU cores used by 10% on average and set the idle checker CPU utilization threshold to 30% on a session having more than 4 CPU cores.
- When the new option is chosen, the session should be terminated as the average (10%) is lower than 30%.
- When the new option is not chosen, the session should keep running as the sum (40% or more) is more than 30%.
- The numbers may be adjusted considering some error margin.

JIRA Issue: BA-2551

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.