Memory problems in NFS client server

Hi all,

i have some doubts in a situation that i fail to get an answer in Google.

I have a solaris 10 nfs server and 5 centos 6.0 nfs clients.

The problem/situation is that in the clients the free memory is "disappearing" along the time (passing to used)..and it gets free if i umount the nfs mount point. I can see also that the speed that the memory is "disappearing" is related to the use of the nfs fs (3 of the 5 servers use the nfs fs more intensively and in those it disappears faster).

I m mounting with:
rw,vers=4,hard,rsize=32768,wsize=32768,noac

Kernel version:2.6.32-71.el6.x86_64 and 2.6.32-220.13.1.el6.x86_64 (i have updated in one server to check the behavior and its the same)

and:

rpm -aq | grep -i nfs
nfs-utils-1.2.2-7.el6.x86_64
nfs4-acl-tools-0.3.3-5.el6.x86_64
nfs-utils-lib-1.1.5-1.el6.x86_64

and in the updated server
nfs4-acl-tools-0.3.3-5.el6.x86_64
nfs-utils-lib-1.1.5-4.el6.x86_64
nfs-utils-1.2.3-15.el6.x86_64

By the way i m checking the memory with the free -m command in this line:
...
-/+ buffers/cache: 480 3286
...
(i did a umount/mount some time ago so now its not bad, but in couple of days it gets the opposite or worse..)

Can someone give me some lights about this behavior?

Thanks

The clients are caching. They are supposed to.

Read this: Help! Linux ate my RAM!

also, try this command:

vmstat -s -S M | egrep 'mem|swap'

If the memory is in cache, you are fine.

Hi mark54g,

Thanks in advance.

I don't think that is the case because i m considering free memory as free + plus buffers and cache.

for example:
free -m
total used free shared buffers cached
Mem: 3767 1684 2082 0 327 871
-/+ buffers/cache: 485 3281
Swap: 1999 0 1999

used memory is 485 and free 3281.

the picture now is good (because i did the umount/mount) lots of free memory (3281) but in a couple of days free memory will tend to 0. i never let it get to 0 because the memory is in "really" used state.

i can put a script in cron to umount and mount the nfs fs but i would like to know and correct this behavior if possible.

Can it be something like a nfs caching? i used the noac option to disable the file attribute caching and so the client as to go all the times to the server to check the status of the file

What do you think?

Thanks

It's not the attribute caching, it is the data. When the problem occurs, you may want to see what is consuming the memory.

Have you run the command I specified?

Also, unmounting an nfs volume is usually a bad idea if traffic is going across.

Try this instead:

sync && echo 3 > /proc/sys/vm/drop_caches

If that fixes your memory issues, it is caching.

regarding the umount of the nfs fs i stoped the server in LB first so no requests were being made when i did the "remount"

Output from a server with the nfs fs mounted for +-2 days
vmstat -s -S M | egrep 'mem|swap'
3766 M total memory
897 M used memory
237 M active memory
428 M inactive memory
2868 M free memory
199 M buffer memory
452 M swap cache
1999 M total swap
0 M used swap
1999 M free swap
0 pages swapped in
0 pages swapped out

Output from a server with the nfs fs mounted for +-6 days
vmstat -s -S M | egrep 'mem|swap'
3767 M total memory
1863 M used memory
355 M active memory
941 M inactive memory
1904 M free memory
197 M buffer memory
1080 M swap cache
1999 M total swap
0 M used swap
1999 M free swap
0 pages swapped in
0 pages swapped out

Other server with +-7 days with the nfs fs mounted
vmstat -s -S M | egrep 'mem|swap'
3767 M total memory
1830 M used memory
376 M active memory
888 M inactive memory
1936 M free memory
204 M buffer memory
1050 M swap cache
1999 M total swap
4 M used swap
1995 M free swap
532 pages swapped in
1285 pages swapped out

i can see an increase of inactive memory and swap cache and in this last one some swap activity.

sync && echo 3 > /proc/sys/vm/drop_caches

solved the issue, this means that it back to the normal state.

Before:
free -m
total used free shared buffers cached
Mem: 3767 1865 1902 0 197 1079
-/+ buffers/cache: 588 3178
Swap: 1999 0 1999

After:
free -m
total used free shared buffers cached
Mem: 3767 186 3580 0 4 21
-/+ buffers/cache: 160 3606
Swap: 1999 0 1999

I m confused, the free -m command in second line i was thinking the used field would be really used memory since free (in that line) is already a sum of free + buffers + cache (from the first line)

Can you give some lights? for example if a program requests memory and the free (2� line) is 0 what will happen?

And client caching in a nfs fs ins't dangerous?

thanks

In the output of the commands I gave you, look to "Active Memory"

This is simply the memory being actively used by the OS and applications. If you dropped your cache, you did not get any free memory back. The memory was always available if you needed it.

Caching is not dangerous. Otherwise network traffic gets to be a burden.