# Recommended GB of RAM / TB stored?

**URL:** <https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823>\
**Category:** FAQ\
**Tags:** ext4\
**Created:** [June 25, 2024, 10:21pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823 "2024-06-25T22:21:20Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![wthorp](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/wthorp/32/1139_2.png) [@wthorp](https://forum.storj.io/u/wthorp)\
**Post date:** [June 25, 2024, 10:21pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/1 "2024-06-25T22:21:20Z")

</div>

I was reading somewhere about a ration of .5-1 GB per TB stored, possibly related to ext4 inodes. I’ve been searching for nearly an hour, and I cannot seem to find where I saw this.  
Can anyone help with a link, and/or an explanation of where this ratio applies the most?

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [June 25, 2024, 10:34pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/2 "2024-06-25T22:34:41Z")

</div>

That seems excessive. The RAM usage of the node itself is more related to the amount of incoming traffic than data stored. But I’d say it’s impossible to make such a general declaration to begin with. If you have slow storage, you’re going to need more RAM. And then file systems such as ZFS might need more RAM as well. Same with certain other RAID solutions. If I’d have to make any statement on it I would say 2GB per node on the safe side. But 1GB per node probably works as long as you have like a minimum of 4GB RAM in the system. But these numbers really depend on many variables.

---

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [June 25, 2024, 10:44pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/3 "2024-06-25T22:44:36Z")

</div>

Please search for my posts on the topic, especially the low i/o storage thread. Sorry, too tired to look for it now.

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [June 26, 2024, 3:00am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/4 "2024-06-26T03:00:58Z")

</div>

> [@wthorp](#):
>
> Can anyone help with a link

> [@On tuning ext4 for storage nodes](https://forum.storj.io/t/on-tuning-ext4-for-storage-nodes/19073/26):
>
> Well, it still works for me. But we know now that this is not always 30%. Smaller inodes mean less memory overhead to keep them, which can make a huge difference if your amount of RAM is between 0.5 and 1 GB per TB of stored data. For this ratio with standard inodes you pretty much need SSD for decent operation, while with smaller inodes you can easily get by without. On the other hand, if you still are above 1 GB per 1 TB of stored data, you will barely see difference, and only in the first f…

---

<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:** [June 26, 2024, 6:44am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/5 "2024-06-26T06:44:29Z")

</div>

In @Toyoo 's thread the assumption was that you want the entire file system cached in RAM for speeding up the walkers and general behavior of your node. So based on the median size of pieces and the size of inodes, there was like 1GB of RAM needed per 1TB of stored data.

---

<div class="post-metadata">

**Author:** ![stuberman](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/stuberman/32/1124_2.png) [@stuberman](https://forum.storj.io/u/stuberman)\
**Post date:** [June 26, 2024, 1:32pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/6 "2024-06-26T13:32:52Z")

</div>

I have three nodes (HDDs) on a single machine using EXT4 storing a total of 31 TiB.  
I have 6GB ram.

free -h  
total used free shared buff/cache available  
Mem: 5.8Gi 506Mi 134Mi 1.0Mi 5.2Gi 5.0Gi  
Swap: 4.0Gi 288Mi 3.7Gi

---

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [June 26, 2024, 11:35pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/7 "2024-06-26T23:35:08Z")

</div>

Indeed. Plus I was assuming a specific average piece size, which has gone down a lot since that time.

So, effectively, default-formatted ext4 requires 256 bytes per file for inode, and ~60 bytes per file for dirnode (file name + 8 bytes), other costs being negligible. So 1 million pieces ≈ 320 MB of metadata.

`mke2fs -I 128` reduces the size of inode, making 1 million pieces’ metadata weight around 190 MB.

Now multiply by average piece size and you will get your numbers per TB stored.

I fully recommend studying ext4 documentation here: [ext4 Data Structures and Algorithms — The Linux Kernel documentation](https://www.kernel.org/doc/html/latest/filesystems/ext4/index.html), it’s pretty well-written.

---

<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:** [June 27, 2024, 4:32am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/8 "2024-06-27T04:32:28Z")

</div>

What’s the average piece size now?  
Found it:  
[https://forum.storj.io/t/node-goes-down-restarts-every-10-15-minutes-thread-allocation-error-in-logs/26010/78?u=snorkel](https://forum.storj.io/t/node-goes-down-restarts-every-10-15-minutes-thread-allocation-error-in-logs/26010/78)

4.34MB segment size.  
29 pieces/segment.  
0.15MB piece size.  
320 bytes of RAM per piece.  
2.133GB RAM/TB of pieces.  
For a 24TB drive (recommanded maximum node size), if you use 23TB allocated, you will need 49GB of RAM. Wow!  
That’s 46GiB of RAM as we messure RAM capacity.

---

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [June 27, 2024, 8:19am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/9 "2024-06-27T08:19:30Z")

</div>

> [@snorkel](#):
>
> 29 pieces/segment.

No longer true. @littleskunk was testing RS codes with 16 pieces per segment, and it seems (almost?) all the recent test data is like that.

---

<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:** [June 27, 2024, 7:09pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/10 "2024-06-27T19:09:36Z")

</div>

So that will give 1.18GB RAM/TB of storage;  
28GB for 23TB node.

---

<div class="post-metadata">

**Author:** ![lookitsbenfb](https://storj.bcdn.literatehosting.com/letter_avatar/lookitsbenfb/32/6_449c533f586939b6e5f246632a46421f.png) [@lookitsbenfb](https://forum.storj.io/u/lookitsbenfb)\
**Post date:** [June 29, 2024, 10:15pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/11 "2024-06-29T22:15:55Z")

</div>

I’ve been running a 18tb on windows computer with 16gb of ram for 3 years without any issues?

Given that I’ve now been learning that windows set up is so much worse than Linux, how can it be that I’ve been doing just fine with what, based on this thread, is way less RAM than I should be using!?

Surely this makes scaling incredibly expensive?

---

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [June 29, 2024, 11:06pm UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/12 "2024-06-29T23:06:04Z")

</div>

I don’t know your setup, so I can’t reason about it, sorry. And even if I did, given you use Windows, I wouldn’t be able to help much, as I don’t use it myself.

In general though, if you can make sure that metadata fit in RAM (or a SSD-based cache), then it is much easier to ensure a fast file walker. But if a slow file walker was never a problem for you, then that’s great, you don’t need it. By fast I mean ~10 minutes per TB of pieces, which is reasonably achievable exactly if metadata of all pieces are placed on a medium faster than HDD.

---

<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:** [June 30, 2024, 6:24am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/13 "2024-06-30T06:24:31Z")

</div>

The biggest and visible influence of RAM is on walkers speed, especialy the startup piece scan. For a high RAM system, this scan that we all call The File Walker, can take a few hours, and for low RAM system a few days, for a 20TB data stored node. You can see my test results on Tuning the Filewalker thread, somewhere in the last posts.  
I run 2x7TB nodes on a Synology with 1GB RAM. I moved the db-es on a flash drive and reduced the log level. They run just fine, all walkers finish, even the startup one, but… it can take even a week or more when they are full.  
But I disabled the lazzy mode and the startup scan on all my nodes. I don’t have to run them on each restart, so not big of a deal now the lack of RAM.  
If you also want to do something else on your system, you want it to be responsive. So here again the more RAM helps a lot.

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [June 30, 2024, 7:49am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/14 "2024-06-30T07:49:29Z")

</div>

Well, technically, we seem to be obsessing about RAM in order to make filewalkers run as quick as possible. But these are not strictly necessary for the node to run just fine (provided no database issues have occurred). Doesn’t matter if it take 2 hours or two days to run.  
This may chime in with @lookisbenfb’s experience.

---

<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:** [June 30, 2024, 11:17am UTC](https://forum.storj.io/t/recommended-gb-of-ram-tb-stored/26823/15 "2024-06-30T11:17:50Z")

</div>

Well, it seems that you realy need to run filewalkers from time to time, and for the huge nodes that we have today, that will only get bigger, to run them in a few days you need a lot of RAM. Imagine the recent testing will be the usual load. Add on top of that a piecescan of 20TB and you have an HDD on full usage 24/7 with walker finishing in weeks.
