-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Response Ops][Task Manager] Resource based task scheduling (#187999)
Resolves #185043 ## Summary ### Task types can define a `cost` associated with running it - Optional definition that defaults to `Normal` cost ### New `xpack.task_manager.capacity` setting - Previous `xpack.task_manager.max_workers` setting is deprecated, changed to optional, and a warning will be logged if used - New optional `xpack.task_manager.capacity` setting is added. This represents the number of normal cost tasks that can be run at one time. - When `xpack.task_manager.max_workers` is defined and `xpack.task_manager.capacity` is not defined, a deprecation warning is logged and the value for max workers will be used as the capacity value. - When `xpack.task_manager.capacity` is defined and `xpack.task_manager.max_workers` is not defined, the capacity value will be used. For the `default` claiming strategy, this capacity value will be used as the `max_workers` value - When both values are set, a warning will be logged and the value for `xpack.task_manager.capacity` will be used - When neither value is set, the `DEFAULT_CAPACITY` value will be used. ### Updates to `TaskPool` class - Moves the logic to determine used and available capacity so that we can switch between capacity calculators based on claim strategy. For the `default` claim strategy, the capacity will be in units of workers. For the `mget` claim strategy, the capacity will be in units of task cost. ### Updates to `mget` task claimer - Updated `taskStore.fetch` call to take a new parameter that will return a slimmer task document that excludes that task state and task params. This will improve the I/O efficiency of returning up to 400 task docs in one query - Applies capacity constraint to the candidate tasks. - Bulk gets the full task documents for the tasks we have capacity for in order to update them to `claiming` status. Uses the `SavedObjectsClient.bulkGet` which uses an `mget` under the hood. ### Updates the monitoring stats - Emitting capacity config value and also capacity as translated into workers and cost. - Added total cost of running and overdue tasks to the health report ## Tasks for followup issues - Update mget functional tests to include tasks with different costs. - #189111 - Update cost of indicator match rule to be Extra Large - #189112 - Set `xpack.task_manager.capacity` on ECH based on the node size - #189117 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
e566abf
commit f1af9b4
Showing
62 changed files
with
4,579 additions
and
1,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.