# Host Resource Limits w/o explicit reservations?

**URL:** <https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834>\
**Category:** Rancher 1.x\
**Created:** [July 10, 2017, 3:50pm UTC](https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834 "2017-07-10T15:50:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maguire007](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@maguire007](https://forums.suse.com/u/maguire007)\
**Post date:** [July 10, 2017, 3:50pm UTC](https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834/1 "2017-07-10T15:50:59Z")

</div>

Had some questions about Host Resource Limits when there are no explicit reservations.

If I have a host with 8gig memory and no containers. Then I set the rancher host Resource Limit to 7 gigs.

So 7 gigs is available.

Then I add 4 java containers in a stack with no mem\_reservation: limits specified.

Question 1) Does the schedule require the reservations to be set for each container for it to apply any limits for the host?

Question 2) What happens if the 4 containers start up and use 7 gigs of the memory and I start a new container with no reservation? Will the new container be limited by the scheduler when there are no specified container reservations?

Any there any best practices for setting reservations for java services w/ jvms? Do you need to set the java opts to match the container reservation so jvm has enough memory?

Thanks!

---

<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:** [July 10, 2017, 6:22pm UTC](https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834/2 "2017-07-10T18:22:36Z")

</div>

Reservations and Limits are two separate things. Reservations are just that and affect only scheduling. Limits restrict how much the container is actually allowed to use once running.

To use reservations effectively you need them on all the significant services. A service with no reservation set reserves nothing and can go to any active host that meets the other scheduling constraints.

---

<div class="post-metadata">

**Author:** ![maguire007](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@maguire007](https://forums.suse.com/u/maguire007)\
**Post date:** [July 11, 2017, 1:29pm UTC](https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834/3 "2017-07-11T13:29:33Z")

</div>

Thanks.

Is mem\_reservation: just an envir variable that can be set as a default value in an image? Or does it have to be applied through the service yml when stack is created or upgraded?

---

<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:** [July 11, 2017, 3:12pm UTC](https://forums.suse.com/t/host-resource-limits-w-o-explicit-reservations/6834/4 "2017-07-11T15:12:27Z")

</div>

It has to applied via yaml when stack is created/updated.
