<br><div>I am working on an app that will write to preallocated files. I can control how big the files are (as long as they are between 4-6GB) and the amount of data sent with each write() call.</div><div>I have a 3.2TB virtual drive that I need to use as much of as possible but performance is the number one concern.</div>

<div><br></div><div>The system is an 8 disk RAID5 with a 256k stripe. Based on this, I am using:</div><div><br></div><div>mkfs.xfs -b size=4096 -l version=2,sunit=512 -d su=256k,sw=7 -f /dev/sdb</div><div><div>meta-data=/dev/sdb               isize=256    agcount=32, agsize=26679232 blks</div>

<div>         =                       sectsz=512   attr=0</div><div>data     =                       bsize=4096   blocks=853735424, imaxpct=25</div><div>         =                       sunit=64     swidth=</div><div> blks, unwritten=1</div>

<div>naming   =version 2              bsize=4096  </div><div>log      =internal log           bsize=4096   blocks=32768, version=2</div><div>         =                       sectsz=512   sunit=64 blks, lazy-count=1</div>
<div>
realtime =none                   extsz=4096   blocks=0, rtextents=0</div><div><br></div></div><div>and</div><div>mount -t xfs -o sunit=512,swidth=3584,inode64,nobarrier,logbufs=8  /dev/sdb /mnt</div><div><br></div><div>Based on what I have read, it appears then my &quot;most optimal&quot; write/read size would be <span style="font-family:Helvetica;font-size:12px">1835008 bytes (3584 *512).</span></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">So based on that, I want to preallocate files somewhere between 4-6GB each that will always begin and end on the stripe unit and stripe width and be a multiple of 1835008.</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">I know that XFS metadata such as the log, AG info, etc also need to be accounted for, but I am not sure the best way to determine how much space they will take.</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">I assume that the fact that, once I set the number of files on the disk, they will not change/expand must be an advantage, but I am unsure how to leverage it.</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">I have tried file sizes in several different multiples of 1835008, but for all of them, bmap -vp has flags 00011.</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">How can I determine the correct file size and preallocate them in a way where they always begin/end on stripe unit/width taking the filesystem overhead into account?</span></font></div>

<div><font face="Helvetica" size="3"><span style="font-size:12px">Note: the log needs to stay on the same fs.</span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px"><br>
</span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px">Thanks</span></font></div><div><span style="font-family:Helvetica;font-size:12px">g3k</span></div>
<div><font face="Helvetica" size="3"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica" size="3"><span style="font-size:12px"><br>
</span></font></div><div><br></div>