Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

add a short sleep in the supervisor's event loop to reduce CPU usage #1080

Merged
merged 7 commits into from
Jul 16, 2021

Conversation

bmc-msft
Copy link
Contributor

Without this sleep, once the Agent.run loop is in the busy state, it is turned into a tight loop calling wait4 of the running agents. This sleep adds a small window to allow the rest of the system to work. Empirical testing shows this has a significant reduction in CPU use.

This sleep should be removed once the worker_runner monitoring is turned into something event driven.

@bmc-msft
Copy link
Contributor Author

Note, this is based off of #1078 , which should be merged before this PR.

The only file with changes unique to this PR is src/agent/onefuzz-supervisor/src/agent.rs

@bmc-msft bmc-msft merged commit 58e5762 into microsoft:main Jul 16, 2021
@bmc-msft bmc-msft deleted the add-supervisor-busy-sleep branch July 16, 2021 17:32
@ghost ghost locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants