moby / swarmkit

A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.
Apache License 2.0
3.34k stars 611 forks source link

Scheduler Rebalancing #310

Open aluzzardi opened 8 years ago

aluzzardi commented 8 years ago

Tasks are currently assigned to Nodes based on a snapshot of information available at that moment.

The scheduler should actually be able to rebalance the cluster based on state change.

For instance, when a new node joins, tasks from other nodes could be assigned to it to spread the load evenly. The decision could be based on preemption and priorities, see #309.

This also applies when a node is updated (different set of labels, change of plugins, etc), the scheduler should re-evaluate whether the node tasks still meet all criterias and reschedule accordingly.

aluzzardi commented 8 years ago

/cc @aaronlehmann

nishanttotla commented 8 years ago

This partially depends on #279.

In addition to the above points, if/when we choose to introduce additional scheduling strategies, the rebalancing should happen in agreement with the strategy. I'm interested in working on this.

overmike commented 7 years ago

Will this story include a case like, reschedule/restart a service which fail to schedule due to lack of reservable memory/cpu.

aaronlehmann commented 7 years ago

If a task couldn't be scheduled because there wasn't enough memory or CPU available anywhere, it should already get scheduled once the resource becomes available.

overmike commented 7 years ago

Seems It is not what is expected in my virtualbox swarm cluster, maybe I should post a bug report