Page 1 of 1

NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 11:31
by FEAR-40
Dear All ,

I had just set up a new Nas4free server with ZFS and 10 GB or ECC ram , and 2 disk in mirror

The server worked just fine , but Something strange happens that the Memory usage is always at 97% capacity ,

did anyone had a similar problem ?
Nas4free Version .: 11.0.0.4 - Sayyadina (revision 4383)

also At the monitoring Page some parts(like CPU clock , memory , Network usage .e.t.c) don't have graphs ...

Thank you in advance
FEAR-40

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 12:19
by mooblie
Yes, I have the "97% RAM usage" phenomena too:

I have two NAS4Free systems - both v.11.0.0.4 - Sayyadina (revision 4303):

- an HP N36L with 8GB RAM, which moves around 37% usage, (normal?) and
- an HP N40L with 16GB RAM, which always sticks at 97% usage (weird??)

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 12:25
by FEAR-40
Dear Martin ,

Yeah it is also strange ... because is literally doing nothing :D not even scrubbing or SMART status or anything .... all process are sleeping except the Web server(GUI)

well I glad that I am not alone ,

and Hope that is not a Sign for Failure , Speaking of Failure I had a BAD SATA cable on the OS drive and it made the CPU and RAM go to 100% for hours(CPU temp 105oC :D LooL) :D Until I realized what was the problem I've changed 2 HDD's 1 SSD , 3 setups and almost a MB , and 7 clean installs :D

I hope this does not happen to anyone else :D

Thank you in advance

FEAR-40

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 16:21
by tony1
it is normal and desired to have high memory usage.
freebsd does a good job at managing memory.

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 16:53
by mooblie
Thanks, Tony.

I thought that maybe high RAM usage was normal and OK (especially when using ZFS), it's just that:
(a) my 8GB RAM NAS4Free has always been low (37%) and
(b) my 16GB RAM NAS4Free has always been high (97%).

It has been like this for several years, over many versions of NAS4Free, and the difference seems rather odd.

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 10 Jul 2017 19:54
by tony1
maybe it's a version issue? older versions use about 1/2 the ram while newer release better manage memory utilization.
bottom line is that it should be using almost all your ram and on a system with low usage it can take some time to fill up.

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 22 Jul 2017 18:05
by kenZ71
A bit late, but I'll offer this comment:

Yes, most of the memory shows as used but it is readily available for other functions as needed. Said differently- think if hiring a few people to do some work. Would you want them sitting around doing nothing when business is slow? Or would it be better to see them go do some busy work / maintenance?

Having said that, no idea what the in use memory is doing when the system is idle. Calculating pi? Searching for extra-terrestrial intelligent life?

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 22 Jul 2017 19:23
by FEAR-40
Well That's the deal, Do stuff that are relevant to me ....
Not to anyone else, so Yes if I have nothing for the workers to do I would like to have them siting on their bottoms , if that is efficient you might ask , no its not, but still is better to work for me than for the guy next door from my paycheck ..

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 23 Jul 2017 16:31
by tony1
Having said that, no idea what the in use memory is doing
its mainly cache. memory will automatically be freed as needed.

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 24 Jul 2017 22:56
by ChriZathens
That's how *nix systems work.
If you have Ram why not use it?

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 26 Jun 2019 17:33
by MikeVR
Same bug. When copy from/to smb share mem grows from fresh restart to 97-98%. And after that - copy errors and mem never comeback (only after restart).
And it's not "how work". vfs.zfs.arc_max limited to 50% now. Other cable tried too.

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 26 Jun 2019 18:53
by ms49434
MikeVR wrote:
26 Jun 2019 17:33
Same bug. When copy from/to smb share mem grows from fresh restart to 97-98%. And after that - copy errors and mem never comeback (only after restart).
And it's not "how work". vfs.zfs.arc_max limited to 50% now. Other cable tried too.
It is not a good idea to set vfs.zfs.arc_max to the highest value right from the beginning, not knowing the requirements of the other services.
It is known that ARC is not quick enough to release resources (here: memory) in an appropriate period of time, therefore it needs a helping hand.

You should always start with a low vfs.zfs.arc_max, i.e. 1-2GB, on systems with 8-16GB memory installed.
Enable monitoring zfs arc and free memory, to get an idea how much memory the other services consume.
Increase vfs.zfs.arc_max in small steps, i.e. by 1GB-2GB.
Read about vfs.zfs.arc_free_target, it could be the better option (instead of vfs.zfs.arc_max), or use a combination of both.

Use case:
One of my production systems had 22GB of RAM with vfs.zfs.arc_max is set to 12GB, showing 730MB free.
This system is running Samba AD, rsync and a few other services - consuming neary 10GB.

Conclusion:
- A system with 16GB memory with all the above services running would be able to provide a maximum of 6GB for ZFS caching, without interfering with other services.
- A system with 8GB memory and all the above services running will encounter issues and will start to swap. vfs.zfs.arc_free_target might an option to release memory early enough.

Remarks:
The above system has been reconfigured in the meantime, using vfs.zfs.arc_free_target only(set to 1M pages = 4GB), so far it's running stable but tests haven't been finished yet.

Hint:
Always start with low values for vfs.zfs.arc_max!

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 27 Jun 2019 16:38
by MikeVR
ms49434 wrote:
26 Jun 2019 18:53
It is not a good idea to set vfs.zfs.arc_max
In reality (my case) doesn't matter what in vfs.zfs.arc_max or it's not set at all - it's ignored: memory always stay full (97-98%) when using smb and not comeback until restart. (problem with any mem size - from 2Gb to 16Gb). Details here. At first I think to disk/lan, but it's connected with memory and soft error (I'm sure now).

Re: NAS is Always at 97% of RAM capacity + Monitoring not working

Posted: 28 Jul 2019 01:32
by Lee Sharp
Try restarting specific services to see if that frees up some of the caching. There are a number of services that can be cache hungry. (Rsync and cifs, I am looking at you!) And yes, my 32gig system are often full when idle.