Scheduling based on host resources

know your documentation clearly states that scheduling based on host resources is not supported in Rancher.

Swarm’s filter tries to provide an available host that fulfills various rresource requirements for the container. For example: $ docker run -ti -m 300M ubuntu:14.04 /bin/bash specifies to run on a host that has a minimum of 300MB.

If you don’t have some kind of resource constraint, I’ll have to add tooling to check my hosts to be sure the are not bogged down.

Is this feature on your road map?

You can add host labels to choose certain classes/groups of machines, but there is not currently anything to schedule based on how much memory is reserved by containers on the host. Among the hosts that match the scheduling rules, the one with the least number of containers is chosen today.

Well, bummer. But just to be clear, Rancher has no throttling at all built in?

And really, my question was about what you have planned in the future in this area.

Not based on memory, no. I would suggest creating an issue with what you’d like to see and we’ll see if there’s any interest.

To be honest I don’t think very many people actually use memory limits. The UI for setting them as broken for a while after Docker changed the validation for memorySwap with minimal complaint :smile:

@ebishop we do plan on adding scheduling based on host resources/capacity. I didn’t see this post earlier but it has come up in discussion internally to add this.

1 Like

That’s great news, Will!

Btw, I didn’t mean to imply scheduling based on memory was the best way to do this. Really, I just want the ability to give Rancher enough information to make scheduling decisions based on resources.

For example, even something like assigning a host a number of tokens, and then if I assign my containers a number of tokens, Rancher could easily calculate if the host had enough available tokens. So if I assigned a host 10 tokens, I could run two containers that consume 5 tokens each, or one stack that consumes 10 tokens. This example is just to illustrate how simple the scheduling hints could be, in my opinion. Trying to use actual system metrics could become very complex for users and for the Rancher code. :slight_smile:

1 Like

Is there any plan on supporting scheduling by resource request?

We implemented this. Here is the documentation:
http://rancher.com/docs/rancher/v1.6/en/rancher-services/scheduler/#resource-constraints