# Resources usage by container

**URL:** <https://forums.docker.com/t/resources-usage-by-container/95793>\
**Category:** General\
**Created:** [June 24, 2020, 3:54pm UTC](https://forums.docker.com/t/resources-usage-by-container/95793 "2020-06-24T15:54:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dockeroz](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@Dockeroz](https://forums.docker.com/u/Dockeroz)\
**Post date:** [June 24, 2020, 3:54pm UTC](https://forums.docker.com/t/resources-usage-by-container/95793/1 "2020-06-24T15:54:00Z")

</div>

Hello,

How Docker manage resources especially RAM and CPU usage.  
For example I run two containers:

1# Postgres  
2# Application

Total memory of host is 8GB.

- How then it will use memory?
- Is this possible to tweak limit resources for certain container?  
Let’s say I want give for container no1. 6GB of RAM and rest for container no.2

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [June 24, 2020, 4:05pm UTC](https://forums.docker.com/t/resources-usage-by-container/95793/2 "2020-06-24T16:05:27Z")

</div>

I would be surprised if somone actualy runs container in production without setting ressource constraints (reservations/limits) for CPU and RAM.

Check the documentation of [docker cli](https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources) or the [compose file reference](https://docs.docker.com/compose/compose-file/#resources) on how to apply the settings.
