Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: Debounce commit events #1287

Merged
merged 1 commit into from
Aug 1, 2016

Commits on Aug 1, 2016

  1. scheduler: Debounce commit events

    When loading a state that contained large numbers of nodes and tasks,
    but no ready nodes that could accept the tasks, swarmd used large
    amounts of CPU repeatedly trying to schedule the full set of tasks. The
    allocator caused many commits on startup (see moby#1286), and this produced
    a large backlog of commit events, each one of which caused a full
    scheduling pass.
    
    To avoid this pathological behavior, debounce the commit events
    similarly to how the dispatcher's Tasks loop debounces events. When a
    commit event is received, that starts a 50 ms countdown to wait for
    another commit event before running the scheduling pass. If commit
    events keep being received and resetting this timer, the scheduler will
    run the scheduling pass anyway after a second.
    
    Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
    aaronlehmann committed Aug 1, 2016
    Configuration menu
    Copy the full SHA
    77c62db View commit details
    Browse the repository at this point in the history