# Container using lots of RAM

**URL:** <https://forum.storj.io/t/container-using-lots-of-ram/22728>\
**Category:** troubleshooting\
**Tags:** docker, memory-consumption, synology-nas\
**Created:** [May 18, 2023, 11:19pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728 "2023-05-18T23:19:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascal](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/pascal/32/7827_2.png) [@pascal](https://forum.storj.io/u/pascal)\
**Post date:** [May 18, 2023, 11:19pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/1 "2023-05-18T23:19:07Z")

</div>

Hi everyone,

Just to make sure, is it normal that my docker container storagenode needs more than 10GB RAM ? It’s been increasing of 2GB since yesterday. No wonder why it crashes the whole server sometimes 😆

 ![image](https://storj-s3.bcdn.literatehosting.net/original/2X/1/16239184b7b639ecab43fbbf94043632df123163.png)

Thanks

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [May 18, 2023, 11:49pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/2 "2023-05-18T23:49:13Z")

</div>

Synology lies about how much ram container is using. It a bug in the ancient version of docker they are using.

Check actual memory usage with top or htop

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 19, 2023, 3:53am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/3 "2023-05-19T03:53:26Z")

</div>

The other way is to use a command

```auto
docker stats

```

---

<div class="post-metadata">

**Author:** ![pascal](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/pascal/32/7827_2.png) [@pascal](https://forum.storj.io/u/pascal)\
**Post date:** [May 19, 2023, 4:00am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/4 "2023-05-19T04:00:44Z")

</div>

> [@Alexey](#):
>
> `docker stats`

Better :). Less than 1GB now

Thank you

---

<div class="post-metadata">

**Author:** ![nyancodex](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nyancodex/32/1129_2.png) [@nyancodex](https://forum.storj.io/u/nyancodex)\
**Post date:** [May 19, 2023, 10:58am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/5 "2023-05-19T10:58:52Z")

</div>

you can add

`> --memory=2g`

into your docker command so the memory will be limited to 2GB which is quite enough to run a node.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [May 19, 2023, 3:15pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/6 "2023-05-19T15:15:18Z")

</div>

> [@nyancodex](#):
>
> memory=2g

Don’t do that.

If your arrays has performance issue the node will get killed.

---

<div class="post-metadata">

**Author:** ![striker43](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/striker43/32/1135_2.png) [@striker43](https://forum.storj.io/u/striker43)\
**Post date:** [May 19, 2023, 6:04pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/7 "2023-05-19T18:04:34Z")

</div>

> [@arrogantrabbit](#):
>
> Don’t do that.
> 
> If your arrays has performance issue the node will get killed.

I am doing this since years, never had any issues with a memory limit.

---

<div class="post-metadata">

**Author:** ![nyancodex](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nyancodex/32/1129_2.png) [@nyancodex](https://forum.storj.io/u/nyancodex)\
**Post date:** [May 19, 2023, 7:30pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/8 "2023-05-19T19:30:17Z")

</div>

I don’t know how it is for you, but for me if a container get killed then it will get restarted instantly so no problem. If you run more things on your node beside storj then you should limit the container memory usage. The code isn’t perfect so memory leak can happen, and if it does then lacking memory can hurt other processes running on the machine.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [May 19, 2023, 8:33pm UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/9 "2023-05-19T20:33:26Z")

</div>

> [@striker43](#):
>
> am doing this since years, never had any issues with a memory limit.

This means you have never reached the limit, and hence, it has no effect, might as well remove it.

> [@nyancodex](#):
>
> but for me if a container get killed then it will get restarted instantly so no problem.

How is it not a problem? Your node gets killed, so you miss out on the portion of the high traffic that caused it to exceed the memory usage in the first place. And then once traffic rebounds – you kill it again. Great. No problem at all.

If you node uses a lot or ram – you should not swipe the symptoms under the rug by killing (pun intended) the messenger; instead, you should improve performance of your disk array.

> [@nyancodex](#):
>
> If you run more things on your node beside storj then you should limit the container memory usage.

Let OS handle that, OS manages memory more nuanced than axe at 2GB threshold. Nodes are known to consume a lot of ram when disk performance is inadequate.

> [@nyancodex](#):
>
> The code isn’t perfect so memory leak can happen, and if it does then lacking memory can hurt other processes running on the machine.

OS will handle that just fine. I could understand if you set memory threshold to, say, 150% of your RAM size – but 2GB is way too little.

You also likely are violating ToS by interfering with node operation.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 20, 2023, 4:10am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/10 "2023-05-20T04:10:27Z")

</div>

Sometimes you forced to use a limit, for example for raspberry pi3 with only 1GB of RAM, otherwise it will just hang when the memory pressure is happened and you would need to physically reset it.  
So, yes, I’m agree that it will reduce a usage, but it’s a smaller evil, than reset a Raspberry Pi3, when you far away.  
However, it’s not the case for Synology NAS and this parameter is not required.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/6_449c533f586939b6e5f246632a46421f.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [May 21, 2023, 8:25am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/11 "2023-05-21T08:25:46Z")

</div>

I run 2 nodes on Synology 216+ with 1GB RAM. 2x 7TB, still filling, one almost full. It never hanged or restarted unexpectedly, the web interface is responsive enough. Sure I loose more races than other nodes, but is still pretty rewarding. I don’t know how raspi is doing with low memory, but Synology is pretty good. I never used memory limitation.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 22, 2023, 4:49am UTC](https://forum.storj.io/t/container-using-lots-of-ram/22728/12 "2023-05-22T04:49:28Z")

</div>

The Raspberry PI3 just hangs forever. But it’s likely because of swap either too small or disabled. For Synology it’s perhaps enabled and have enough room to grow.
