I have an answer from our application developer about the sync methods used when for files written to disk. Your question was:
Another question is whether the files are being sync'd to disk (e.g. application calling fsync() for each file, or opening with O_SYNC, or marking the directory dirsync)?
From our developer:
"To answer your question, SiLK does not use fsync() or any of the
other sync methods mentioned.
When rwreceiver receives a file, it uses mmap() to allocate space on
disk and writes the blocks it receives into that space. mmap()
works best when the files are on a local disk.
The main processing loop of rwflowappend does the following:
1. Get the name of an incremental file.
2. Open the incremental file for read and read its header.
3. Determine which hourly file corresponds to the incremental file.
4. Check to see if the hourly file exists. If yes, goto 5. If no,
goto 9.
5. open() the existing hourly file with flags O_RDWR | O_APPEND. If
open() fails because the file does not exist, goto 10.
6. Get a write lock on the hourly file.
7. Attempt to read() the hourly file's header. If that fails
because no bytes are available, use fcntl() to remove O_APPEND
from the file's flags and goto 13.
8. Goto 14.
9. Check whether directory path to the hourly file exists. If not,
create it.
10. open() the new file with flags O_RDWR | O_CREAT | O_EXCL. If
open() fails because the file already exists, goto 5.
11. Get a write lock on the file.
12. Attempt to read the hourly file's header. If that unexpectedly
succeeds, use fcntl() to add O_APPEND to the file's flags, and
goto 14.
13. Write the new hourly file's header.
14. Read records from the incremental file and write them to the
hourly file.
15. fflush() the hourly file. If fflush() fails, ftruncate() the
file to its original size.
16. close() the hourly file.
17. close() the incremental file and dispose of it.
18. Goto 1.
Writing the file's header involves a few write() calls on small
buffers.
Writing the SiLK Flow records uses write() on a block whose maximum
size is 64k.
Note that each incremental files involves an open(), write(),
fflush(), close() sequence on the hourly file. If the incremental
files are small, there will be a lot of overhead due to the repeated
calls to open() and close()."
So based on this and what you suggested before, we are studying the possibility of moving our collection (the rwreceiver process) to work on local disk rather than Lustre fs. The appended files and subsequent data at rest will still be stored on Lustre fs.
Please let me know if you have other questions or suggestions.
Thanks,
George Jackson
Please close this ticket as resolved based on recommendations made and implemented regarding striping. Other suggestions will be taken into account.
Thanks,
George Jackson