Page 1 of 1

High Memory Usage

Posted: 23 Jan 2017 12:45
by lawrencezarb
I am currently running 11.0.0.4 rev 3460 and notices that my memory useage at idle is always at around 94%. I do use ZFS and use the sytem as a Nas server for a media playback device.

TOP seems to indicated high memory useage for php-cgi processes as below:

last pid: 11296; load averages: 0.55, 0.52, 0.36
34 processes: 3 running, 31 sleeping
CPU: 8.3% user, 0.0% nice, 17.9% system, 0.0% interrupt, 73.8% idle
Mem: 30M Active, 39M Inact, 736M Wired, 12M Buf, 12M Free
Swap: 1024M Total, 53M Used, 971M Free, 5% Inuse

PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
4070 root 1 20 0 20120K 2832K CPU0 0 0:04 19.28% top
2438 root 1 52 0 393M 15112K RUN 1 0:10 3.27% php-cgi
3165 root 1 20 0 51436K 4828K select 2 0:01 1.20% sshd
1991 root 1 20 0 10436K 1180K select 3 0:01 0.33% powerd
2442 root 1 52 0 391M 11764K accept 0 0:06 0.00% php-cgi
2421 root 1 52 0 391M 12584K accept 0 0:01 0.00% php-cgi
2418 root 1 20 0 47472K 3760K kqread 2 0:01 0.00% lighttpd
2422 root 1 21 0 391M 9636K accept 2 0:01 0.00% php-cgi
3177 root 1 20 0 21732K 3276K pause 1 0:00 0.00% csh
2420 root 1 52 0 391M 0K wait 2 0:00 0.00% <php-cgi>
2069 root 1 20 0 233M 4496K select 0 0:00 0.00% nmbd
2517 root 1 52 0 13688K 2252K wait 0 0:00 0.00% bash
2258 root 1 24 0 12564K 796K nanslp 1 0:00 0.00% cron
2419 root 1 52 0 391M 0K wait 0 0:00 0.00% <php-cgi>
1801 root 7 52 0 8304K 1340K rpcsvc 2 0:00 0.00% nfsd
2018 root 1 20 0 32308K 2516K select 0 0:00 0.00% proftpd
2444 root 2 20 0 10792K 1764K nanslp 0 0:00 0.00% inadyn
2071 root 1 52 0 298M 9460K select 1 0:00 0.00% smbd
1800 root 1 20 0 8304K 1580K select 3 0:00 0.00% nfsd
1660 root 1 20 0 10492K 1456K select 1 0:00 0.00% syslogd
2721 root 1 52 0 21732K 2884K pause 0 0:00 0.00% csh
1498 root 1 20 0 9512K 1140K select 2 0:00 0.00% devd
1682 root 1 20 0 10424K 1384K select 1 0:00 0.00% rpcbind
2718 root 1 52 0 43732K 2200K wait 0 0:00 0.00% login
1807 root 1 52 0 10452K 1320K rpcsvc 1 0:00 0.00% rpc.lockd
2760 root 1 52 0 13224K 2380K ttyin 1 0:00 0.00% sh
2076 root 1 20 0 295M 6292K select 1 0:00 0.00% smbd
2719 root 1 46 0 10460K 1532K ttyin 2 0:00 0.00% getty
11296 root 1 72 0 8308K 1536K CPU3 3 0:00 0.00% sysctl
2720 root 1 46 0 10460K 1532K ttyin 1 0:00 0.00% getty
2167 root 1 20 0 26596K 2352K select 3 0:00 0.00% sshd
1804 root 1 20 0 266M 1340K select 2 0:00 0.00% rpc.statd
1784 root 1 52 0 10468K 1620K select 3 0:00 0.00% mountd
10789 root 1 52 0 6244K 1476K nanslp 3 0:00 0.00% sleep

Re: High Memory Usage

Posted: 23 Jan 2017 13:10
by spy0r
Hi,

you should read: viewtopic.php?f=15&t=9536
I'm sure this can answer your questions.

Greetings

Re: High Memory Usage

Posted: 23 Jan 2017 14:25
by lawrencezarb
Hi spy0r, Thanks.

I read the thread and changing the vfs.zfs.arc_max seems in loader.conf to make no difference what so ever.

When I run sysctl vfs.zfs.arc_max the result is always the same:

vfs.zfs.arc_max: 536153600

Re: High Memory Usage

Posted: 24 Jan 2017 09:34
by spy0r
i'm not sure, but i think you have to activate that line in the loader.conf if you did this via GUI, there should be a small checkbox or something like that...

Re: High Memory Usage

Posted: 24 Jan 2017 10:33
by lawrencezarb
yes I did that and notice the the line was activated in loader.conf.local. I also tried to add the line in loader.conf from the ssh shell, but after a reboot I still get the same results.

Re: High Memory Usage

Posted: 24 Jan 2017 13:38
by spy0r
okay, in this case anybody else need to help.

My question is - why do you want to reduce the RAM for zfs usage? You have that less memory, you should give zfs every byte you got. It's not a bug that you have high ram usage... Does you swap fill up over ~1Gb?

Re: High Memory Usage

Posted: 24 Jan 2017 14:01
by lawrencezarb
I dont use ZFS, so I have no need for it use up the memory. The swap file does not fill up but it does get used. The system seems sluggish when access files, which I assume is due to the memory availability.

Re: High Memory Usage

Posted: 24 Jan 2017 15:21
by spy0r
lawrencezarb wrote:
23 Jan 2017 12:45
I am currently running 11.0.0.4 rev 3460 and notices that my memory useage at idle is always at around 94%. I do use ZFS and use the sytem as a Nas server for a media playback device.

I think there was missing a "NOT". In that case you don't need to tweak zfs parameters...

Re: High Memory Usage

Posted: 25 Jan 2017 09:24
by lawrencezarb
Sorry for the Typo, yes the NOT is missing and I can understand that it sheds a different light on my problem.

Re: High Memory Usage

Posted: 05 Feb 2017 20:11
by awebster
I've got something very similar going on. Maybe 8 or 9 <php-cgi> processes that top says have SIZE 391M. I'm using 11.0.0.4 r3460. I've got some home devices that stream http from the nas4free webserver. I AM using ZFS.
I haven't noticed any issues with the high memory usage. It just shows that 80% is used of 8gig memory. I may see if I have another 8 gig stick to throw in there.

Re: High Memory Usage

Posted: 06 Feb 2017 12:03
by lawrencezarb
I have increased my ram form 1G to 2 G and now the memory useage is down to 50%

Re: High Memory Usage

Posted: 11 Feb 2017 16:19
by zoon01
lawrencezarb wrote:
06 Feb 2017 12:03
I have increased my ram form 1G to 2 G and now the memory useage is down to 50%
You should add more ram if you can.
The system you do use is really on it's minimum specification.

Re: High Memory Usage

Posted: 20 Feb 2017 17:53
by leo1986pc
zoon01 wrote:
lawrencezarb wrote:
06 Feb 2017 12:03
I have increased my ram form 1G to 2 G and now the memory useage is down to 50%
You should add more ram if you can.
The system you do use is really on it's minimum specification.

Code: Select all

  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
 2590 root            9  20    0   260M 32664K nanslp  1 346:21  14.36% fuppesd
 2473 root            1  20    0   396M 44992K piperd  0   0:10   0.10% php-cgi
 2212 transmission    3  20    0 68752K  8272K kqread  0   2:20   0.00% transmission-daemon
 1881 root            1  20    0 10436K  2048K select  3   0:12   0.00% powerd
 2467 root            1  20    0 49520K  6972K kqread  2   0:12   0.00% lighttpd
 2472 root            1  52    0   396M 46364K accept  0   0:10   0.00% php-cgi
 1908 root            1  20    0 32308K  6704K select  1   0:07   0.00% proftpd
 2022 root            1  20    0   231M 15268K select  1   0:07   0.00% nmbd
 1667 root            1  20    0 10492K  2252K select  3   0:04   0.00% syslogd
 2493 root            2  20    0 10792K  2612K nanslp  0   0:04   0.00% inadyn
 2024 root            1  20    0   296M 24432K select  0   0:01   0.00% smbd
 2318 root            1  20    0 12564K  2384K nanslp  2   0:01   0.00% cron
 2029 root            2  20    0   295M 20180K select  0   0:01   0.00% smbd
 2267 root            1  20    0 26596K  5548K select  2   0:00   0.00% sshd
 2382 root            1  20    0  8784K  2520K select  0   0:00   0.00% mDNSResponderPosix
 1539 root            1  20    0  9512K  5464K select  1   0:00   0.00% devd
 2072 root            1  20    0 26744K  4472K nanslp  0   0:00   0.00% smartd
 2468 root            1  52    0   389M 40664K wait    0   0:00   0.00% php-cgi
 2471 root            1  52    0   389M 40664K wait    1   0:00   0.00% php-cgi
40184 root            1  22    0 20120K  3008K CPU2    2   0:00   0.00% top
 2699 root            1  52    0 21732K  3640K pause   0   0:00   0.00% csh
 2696 root            1  52    0 43732K  2916K wait    3   0:00   0.00% login
 2713 root            1  52    0 13224K  3180K ttyin   3   0:00   0.00% sh
 2698 root            1  52    0 10460K  2092K ttyin   0   0:00   0.00% getty
 2697 root            1  52    0 10460K  2092K ttyin   1   0:00   0.00% getty
I have the same problem but my system's memory is 4GB.

With N4F 10, the same configuration with and 2 VMs active (with low memory but active) I had an average usage of 85-90% in my system.

Do I have to increase the memory?

Re: High Memory Usage

Posted: 20 Feb 2017 18:22
by zoon01
The more ram you have, the better the system can run all it's services, and with zfs and 2 vm's active I think you need at least 8GB to 16GB te get in optimal performance.

But who am I to say so, I use 32Gb ram now after running for a while on 16GB.
ZFS loves RAM and so does my VM's

Re: High Memory Usage

Posted: 20 Feb 2017 19:32
by raulfg3
+1

I have 6GB on one NAS and need to revise VM not to discontrol, (ZFS+Transmission+minidlna+2 VM is too much for my only 6GB RAM NAS)