Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We mount without using noac. I have a file that I append to once every 20 minutes. Then it will be read with mmap about 5,000 times a minute. We only mmap a couple blocks for each read. Needless to say, noac just kills the access performance, so we don't use it.

I add data to the end of the file using a mount with noac and read from a mount without noac. The mounts that are reading are not seeing the new data.

I want to know if there is a function I can call from c to refresh the attributes of a path and all its files.

EDIT: I should add we cannot mount and unmount since there are 16 servers running on each system and they are constantly accessing the files. Well...maybe we could mount and unmount if each server used their own mount. I'd like to avoid that if possible.

thanks!

share|improve this question
add comment

1 Answer 1

Hmmm.....try mounting the NFS filesystem with the 'sync' option.

And check out this extract of the man page: (man 5 nfs)

The sync mount option.

The NFS client treats the sync mount option differently than some other file systems (refer to mount(8) for a description of the generic sync and async mount options). If neither sync nor async is specified (or if the async option is specified), the NFS client delays sending application writes to the server until any of these events occur:

          Memory pressure forces reclamation of system memory resources.

          An application flushes file data explicitly with sync(2), msync(2), or fsync(3).

          An application closes a file with close(2).

          The file is locked/unlocked via fcntl(2).

In other words, under normal circumstances, data written by an application may not immediately appear on the server that hosts the file.

If the sync option is specified on a mount point, any system call that writes data to files on that mount point causes that data to be flushed to the server before the system call returns control to user space. This provides greater data cache coherence among clients, but at a significant performance cost.

Applications can use the O_SYNC open flag to force application writes to individual files to go to the server immediately without the use of the sync mount option.

share|improve this answer
    
We use two mounts, one for writing which has noac,rw, etc set. The one used for all the reading has a large attribute timeout and ro. I want to know how to get the read only mount with attribute caching to refresh its cache. An application that does reading will do several thousand reads per transaction. I want to force the file attributes to refresh only once per transaction, not several thousand times as would noac. –  johnnycrash Oct 30 '12 at 22:06
    
Any why do you feel that sync mode will not work? –  mdpc Oct 30 '12 at 22:16
    
Should I use that on the client's mount or the process that is building the indexes' mount? –  johnnycrash Oct 30 '12 at 23:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.