I would like to understand how the fileserver workload works. By referring to the flowop below:
define process name=filereader,instances=1
flowop createfile name=createfile1,filesetname=bigfileset,fd=1
flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize
flowop closefile name=closefile1,fd=1
flowop openfile name=openfile1,filesetname=bigfileset,fd=1
flowop appendfilerand name=appendfilerand1,iosize=$meanappendsize,fd=1
flowop closefile name=closefile2,fd=1
flowop openfile name=openfile2,filesetname=bigfileset,fd=1
flowop readwholefile name=readfile1,fd=1,iosize=$iosize
flowop closefile name=closefile3,fd=1
flowop deletefile name=deletefile1,filesetname=bigfileset
flowop statfile name=statfile1,filesetname=bigfileset
I notice that for almost every flowop except the last 2, there is fd=1 mentioned in the flowop. So it means that most of the flowop work on a single file? So does it means that the flowop will never apply to the those files pre-created before the actual test? And as for this fileserver.f, the default nthread is 50; does it means the fd will be unique for each nthread so thread 1 file and thread 2 file will not be the same file?
Thanks for the time and hope some kind soul can help to address my doubt. :)
Your understanding is incorrect. Here is what's going on:
1) "fd=1" in createfile flowop means that the newly created file will be assigned file descriptor 1
2) "fd=1" in writewholefile flowop means that write will go to the file, associated with file descriptor 1 (i.e. previously created)
3) after that, we close file descriptor 1, so it can be reused by other flowops. I.e., same file descriptor can refer different files.
4) In the next cycle of execution, other file will be created (but with the same fd=1) and written to.
5) File descriptors are per-thread objects
You can read more details here:
Thanks for your reply.
So just to make myself clear, since the closefile already close the fd 1, the openfile flowop will open a file randomly in the filesets and assign fd 1 to that file. is this correct?