How do I speed up and cache mmap file access over NFS on Linux?
Posted
by
Zan Lynx
on Server Fault
See other posts from Server Fault
or by Zan Lynx
Published on 2011-12-13T00:36:10Z
Indexed on
2013/10/26
9:57 UTC
Read the original article
Hit count: 209
The server and client are both 64-bit Ubuntu 10.04 LTS.
The application in question is a custom app that uses mmap()
for fast random file access. Its ideal state is when the entire file is cached in RAM.
The network connections are really fast 10Gb Ethernet. It is a virtual server blade setup.
It isn't the network connections slowing things down because everything performs superbly when using a virtual disk (iSCSI to the SAN). But when we run the application on a NFS home directory mount, performance goes to the dogs.
It appears that the Linux kernel isn't caching anything. So it is reading every single disk block needed by mmap()
accesses over and over and over again.
The NFS mount is done through autofs, which has only default settings. /proc/mounts
shows the NFS mount is done with the following options:
rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.11.52,mountvers=3,mountproto=tcp,addr=192.168.11.52
How can I make Ubuntu 10.04 cache the file instead of reloading it all the time?
© Server Fault or respective owner