# Tuning EXT4 vfs\_cache\_pressure

**URL:** <https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106>\
**Category:** Node Operators\
**Tags:** hardware\
**Created:** [May 6, 2024, 5:09pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106 "2024-05-06T17:09:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [May 6, 2024, 5:09pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/1 "2024-05-06T17:09:28Z")

</div>

We are all in the middle of a mess. GC here… trash cleanup there… growing ingress data…  
I want to talk here about vfs\_cache\_pressure. I think an important setting after all tunings discussed on filesystem.  
I tried 100… 80… never gone less (afraid of making a mistake). Someone have done some test?

---

<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 6, 2024, 5:16pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/2 "2024-05-06T17:16:52Z")

</div>

100 is a default.

What issue are you seeing that you are trying to solve? Memory starvation? Reducing the value will make it worse.

---

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [May 6, 2024, 5:56pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/3 "2024-05-06T17:56:09Z")

</div>

Optimize ram for storj. I assumed that the server will only be used as a storj node.  
I want the ram to be used almost primarily for metadata and not file cache.

---

<div class="post-metadata">

**Author:** ![andrew2.hart](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/andrew2.hart/32/6415_2.png) [@andrew2.hart](https://forum.storj.io/u/andrew2.hart)\
**Post date:** [August 2, 2024, 7:46am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/4 "2024-08-02T07:46:56Z")

</div>

I’ve tried vfs\_cache\_pressure at 10 for a few weeks, now changed to 5. I’m not sure I can see any difference

---

<div class="post-metadata">

**Author:** ![EasyRhino](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/easyrhino/32/1133_2.png) [@EasyRhino](https://forum.storj.io/u/EasyRhino)\
**Post date:** [August 2, 2024, 9:03pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/5 "2024-08-02T21:03:19Z")

</div>

I only have one ext4 drive, and i’m migrating it to zfs.

But messing with vfs\_cache pressure didn’t seem to make it use any more memory for cache or buffer.

For ext4:

mounting with noatime is definitely easy to do and should help performance, and is fairly harmless.

formatting with 128byte inode is worth considering, but I haven’t tried it.

possibly mounting with data=writeback instead of data=journaled might help performance, at the risk of corruption in a disk outage. Doesn’t seem to help with read activity (like a filewalker)

Other folks have worked on setting up bcache or lvmcache with a SSD paired with a ext4 drive.

---

<div class="post-metadata">

**Author:** ![andrew2.hart](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/andrew2.hart/32/6415_2.png) [@andrew2.hart](https://forum.storj.io/u/andrew2.hart)\
**Post date:** [August 4, 2024, 7:56am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/6 "2024-08-04T07:56:45Z")

</div>

After a couple of days running with vfs\_cache\_pressure on 5  
time du -hs /node5/node5/storage/\*  
1.1T /node5/node5/storage/blobs  
40M /node5/node5/storage/piece\_expiration.db  
148G /node5/node5/storage/trash  
…  
real 12m8.094s  
user 0m4.851s  
sys 0m41.259s

There’s something wrong with those figures

![image](https://storj-s3.bcdn.literatehosting.net/original/3X/9/6/9629aa2bfa99ce3a5fa238e5c81cd6f9063e1c18.png)

/node5/node5/storage/trash# du -hs \*/\*  
3.8G pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/2024-07-28  
16G pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/2024-08-01  
70G pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/2024-08-03  
647M qstuylguhrn2ozjv4h2c6xpxykd622gtgurhql2k7k75wqaaaaaa/2024-07-30  
20G ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/2024-07-28  
10G ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/2024-07-29  
8.2G ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/2024-07-31  
7.6G ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/2024-08-02  
3.7G v4weeab67sbgvnbwd5z7tweqsqqun7qox2agpbxy44mqqaaaaaaa/2024-07-28  
2.0G v4weeab67sbgvnbwd5z7tweqsqqun7qox2agpbxy44mqqaaaaaaa/2024-07-30  
3.4G v4weeab67sbgvnbwd5z7tweqsqqun7qox2agpbxy44mqqaaaaaaa/2024-08-01  
3.5G v4weeab67sbgvnbwd5z7tweqsqqun7qox2agpbxy44mqqaaaaaaa/2024-08-04

---

<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:** [August 4, 2024, 8:03am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/7 "2024-08-04T08:03:42Z")

</div>

with `-h` you would get a binary measure units, so 1.1T is 1.1TiB and this is 1.21TB in SI, used on the dashboard, 148G is 148GiB and this is 158.91GB in SI. Next time I would suggest to use `--si` instead of `-h`.  
However, if you running 1.109, it again has issues with updating databases on delete.

> [@1.109.2: Trash size is no longer updated](https://forum.storj.io/t/1-109-2-trash-size-is-no-longer-updated/27379/2):
>

In short - you need to enable the scan on startup if you disabled it (it’s enabled by default) and restart the node to correct the usage in the databases.  
Right now to reduce a time for the filewalkers you may enable a badger experimental feature:

> [@Badger cache filewalker test results](https://forum.storj.io/t/badger-cache-filewalker-test-results/27334):
>
> System Windows 10 OS. RAM 24GB RAM total 10 nodes HDD 2.5 ST1000LM 1TB HDD 900GB Alocated, it overused to 931 GB so Node is Full First Run 2024-07-28T13:52:17+03:00 INFO pieces used-space-filewalker started {Satellite ID: 1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE} 2024-07-28T16:47:32+03:00 INFO pieces used-space-filewalker completed {Satellite ID: 1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE, Lazy File Walker: false, Total Pieces Size: 591950544640, Total Pieces C…

---

<div class="post-metadata">

**Author:** ![andrew2.hart](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/andrew2.hart/32/6415_2.png) [@andrew2.hart](https://forum.storj.io/u/andrew2.hart)\
**Post date:** [August 4, 2024, 9:42am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/8 "2024-08-04T09:42:04Z")

</div>

I understand that, thanks. I have 148GiB of trash and the dashboard shows 41.52GB because 1.109 is not updating the databases.

So, 12 minutes to du the whole 1.1TiB plus .14TiB trash seems quite quick enough. Except I did notice ssh being clunky after the du run, like it was swapping, so I think vfs\_cache\_pressure=5 is too low, possibly

---

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [August 4, 2024, 9:48am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/9 "2024-08-04T09:48:33Z")

</div>

I’m using pressure=1 for a long time now. No problem at all.

---

<div class="post-metadata">

**Author:** ![andrew2.hart](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/andrew2.hart/32/6415_2.png) [@andrew2.hart](https://forum.storj.io/u/andrew2.hart)\
**Post date:** [August 4, 2024, 9:49am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/10 "2024-08-04T09:49:51Z")

</div>

How much RAM do you need to run at =1?

---

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [August 4, 2024, 2:36pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/11 "2024-08-04T14:36:43Z")

</div>

I don’t think is relevant. Is not 0. With pressure=0 you MUST have enough RAM for everything.  
RAM needs depend if you gave one node or multiple nodes

---

<div class="post-metadata">

**Author:** ![andrew2.hart](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/andrew2.hart/32/6415_2.png) [@andrew2.hart](https://forum.storj.io/u/andrew2.hart)\
**Post date:** [August 5, 2024, 3:48pm UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/12 "2024-08-05T15:48:29Z")

</div>

I wanted to add a point since it might help someone debug something. The trash figure is being updated ( I have not restarted the node )  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/8/5/859999730172e4039f71ad5242eac6e458ef5354.png)  
So I think/propose that the trash is being removed from the trash folders and the db is updating there but when the data is moved to the trash folders it is not updating.  
The node has uptime 154h 50m so it hasn’t restarted itself either.  
I wonder if the trash total will go negative?  
Let me know if there is anything I can test for you, sorry I can’t code

---

<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:** [August 6, 2024, 5:04am UTC](https://forum.storj.io/t/tuning-ext4-vfs-cache-pressure/26106/13 "2024-08-06T05:04:40Z")

</div>

I think at the moment, we can do nothing except restart and allow the filewalker to fix a discrepancy. I would hope that the next release has a fix for the trash updates too.
