# Scheduling based on host resources

**URL:** <https://forums.suse.com/t/scheduling-based-on-host-resources/618>\
**Category:** Rancher 1.x\
**Created:** [October 2, 2015, 5:20pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618 "2015-10-02T17:20:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebishop](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ebishop](https://forums.suse.com/u/ebishop)\
**Post date:** [October 2, 2015, 5:20pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/1 "2015-10-02T17:20:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 2, 2015, 6:03pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/2 "2015-10-02T18:03:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ebishop](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ebishop](https://forums.suse.com/u/ebishop)\
**Post date:** [October 2, 2015, 9:40pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/3 "2015-10-02T21:40:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 2, 2015, 10:13pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/4 "2015-10-02T22:13:21Z")

</div>

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 😄

---

<div class="post-metadata">

**Author:** ![willchan](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/willchan/32/2856_2.png) [@willchan](https://forums.suse.com/u/willchan)\
**Post date:** [October 3, 2015, 4:03pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/5 "2015-10-03T16:03:55Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ebishop](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ebishop](https://forums.suse.com/u/ebishop)\
**Post date:** [October 4, 2015, 12:22am UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/6 "2015-10-04T00:22:47Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![xiangjunz](https://avatars.discourse-cdn.com/v4/letter/x/f08c70/32.png) [@xiangjunz](https://forums.suse.com/u/xiangjunz)\
**Post date:** [September 13, 2017, 2:27pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/7 "2017-09-13T14:27:17Z")

</div>

Is there any plan on supporting scheduling by resource request?

---

<div class="post-metadata">

**Author:** ![cjellick](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjellick/32/2876_2.png) [@cjellick](https://forums.suse.com/u/cjellick)\
**Post date:** [September 13, 2017, 9:02pm UTC](https://forums.suse.com/t/scheduling-based-on-host-resources/618/8 "2017-09-13T21:02:25Z")

</div>

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