Feature Request: Memory Cleaning Daemon

Tell us your most wanted new features, or recommendation.
Locked
User avatar
Saijin_Naib
Posts: 79
Joined: 23 Jun 2021, 01:19

Feature Request: Memory Cleaning Daemon

Post by Saijin_Naib »

I think it would be great if we could have an (optional) service we could run to try and flush cache, etc, especially on lower-spec units like the F2-210 I'm using.

It would consist of something like this as a cron job to run on a schedule that the user could modify:
sync; echo 3 > /proc/sys/vm/drop_caches

Source:
https://www.tecmint.com/clear-ram-memor ... -on-linux/

I was noticing that after a large SMB transfer of about 800GB that my F2-210 was not releasing the cache and was hovering at around 44% memory usage. I think having this daemon run in the background would be helpful.
User avatar
TMroy
TerraMaster Team
Posts: 2578
Joined: 10 Mar 2020, 14:04
China

Re: Feature Request: Memory Cleaning Daemon

Post by TMroy »

Things are not as you think. Memory is designed to speed up system performance. Because of the lack of cache, system performance will slow down actually, and the cache will still be reloaded soon or later. Why do you have to keep the memory usage low? In my opinion, the best option is to keep the system in the best state of operation, instead of always low memory usage.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Support team: support(at)terra-master.com (for technical support only)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
Saijin_Naib
Posts: 79
Joined: 23 Jun 2021, 01:19

Re: Feature Request: Memory Cleaning Daemon

Post by Saijin_Naib »

{L_BUTTON_AT}TMroy
I agree with you. However, there are a number of processes on my TOS device that seem to keep growing in RAM usage over time, and I am concerned about the long-term stability of this platform under load if resource consumption keeps growing.

I've seen too many posts here of other people with F2-210 having random reboots, crashes, power-off, etc. which look like possible OOM crash/reset patterns.

Judging by how high the memory usage under load gets with my F2-210 (70%+ under load), I am concerned that such behavior is not far off for my unit. I have nothing running but Samba (no apps, even), so there is really not much more I can do on my end to keep it running well, as you suggest.
User avatar
TMroy
TerraMaster Team
Posts: 2578
Joined: 10 Mar 2020, 14:04
China

Re: Feature Request: Memory Cleaning Daemon

Post by TMroy »

So the issue will be which process always take a lot of memory, and is this reasonable? need to check case by case.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Support team: support(at)terra-master.com (for technical support only)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
demetry14
Posts: 20
Joined: 22 Nov 2020, 05:23

Re: Feature Request: Memory Cleaning Daemon

Post by demetry14 »

Saijin_Naib wrote: 30 Jun 2021, 02:08 I think it would be great if we could have an (optional) service we could run to try and flush cache, etc, especially on lower-spec units like the F2-210 I'm using.

It would consist of something like this as a cron job to run on a schedule that the user could modify:
sync; echo 3 > /proc/sys/vm/drop_caches

Source:
https://www.tecmint.com/clear-ram-memor ... -on-linux/

I was noticing that after a large SMB transfer of about 800GB that my F2-210 was not releasing the cache and was hovering at around 44% memory usage. I think having this daemon run in the background would be helpful.
crontab -e
* * * * * command_to_execute
| | | | |Day of the Week ( 0 - 6 ) ( Sunday = 0 )
| | | Month ( 1 - 12 )
| | Day of Month ( 1 - 31 )
| Hour ( 0 - 23 )
Min ( 0 - 59 )

in crontab add new lines for (change * * * * * to your needed values and echo something higher than 60 to relieve more ram):
* * * * * sync; echo 3 > /proc/sys/vm/drop_caches


swappiness (change echo 60 to your needed value):
0 : Swapping will be activated urgently only to avoid out of memory condition.
60 : This is the default value and means that from 40% of Ram occupancy, the kernel writes to the swap.
100 : The kernel will swap aggressively.

in /etc/sysctrl.conf add to the bottom and provide a number above 60.
vm.swappiness =
~~
Demetry

F2-210
F4-210
Locked