I am writing a streaming server for linux that reads files from CIFS mounts and sends them over a socket. Ideally, linux will cache the file in memory so that subsequent reads will be faster. Is this the case? Can I tell the kernel to cache network reads ?
Edit: there will be multiple reads, but no writes, on these files.
Thanks!
Update: I've tested this on a CIFS volume, using fadvise POSIX_FADV_WILLNEED to cache the file locally (using linux-ftools on command line). Turns out that the volume needs to be mounted in read-write mode for this to work. In read only mode, the fadvise seems to be ignored. This must have something to do with the samba oplock mechanism.