im having some issue with r2032. i did "wit copy" using the default setting trying to see the speed increase when writing to NTFS. as soon as i did that, the lights on my HDD started lighting up like it is being written to.
Now its 10 minutes later, the lights on the HDD have been lighting up for the entire time, so wit is doing something on my HDD. after the 10 minutes, it starts printing stuff out stdout. it is writing at 1.3MBs. before it was writing to this same HDD at ~30MBs. its doing the same thing when writing to FAT32. I havent tested writing to ext yet.
@giantpune 2 days ago i have a similar but not reproducible effect while using a relative full drive (12 of 40G free). I worked with enabled trace and I know that the preallocation call of about 1.5 GB takes all the time. Immediately doing the same command again works fine and fast and it never happens again. It seems for me as an NTFS cleanup trigger.
My question to you: What happen if your are doing it again?
i tried it again on the same NTFS HDD and i get the same result. It is a 1TB drive full of movies, so it is all files > 700MB. And i have 159GB of free space. So, does this mean that first it must move some of these full 700MB movies to create a block of 4GB before it can write the file? And judging be the time of it, it is having to move 3 or 4 movies to make room.
And does it start the time for calculating the transfer speed after it has started writing the file? or does it start the time before it tries to allocate the space on the drive? because it seems that when i try to copy a larger game, it takes longer to start the actual copy and when it does, the speed is slower ( 0.7 MBs reported for a 4GB game ).
and what happens to the allocated disc space if i forcibly interrupt wit? when is the space freed? and who is responsible for unallocating it?
heres teh trace file created when using wit copy to copy a 4GB game from ext4 to my NTFS partition that has all those movies on it. It took something like 15-20 minutes http://www.multiupload.com/G8ENAJ0STF
I can't see not so much because there are to less trace commands in the preallocate functions. I will change that tomorrow. What happens if you split for example with 500m or 1g? If you do so i wit will not try to prealloc 4.7g at once.
My guess: Windows/NTFS tries to allocate that ordered space in 1 fragment and must sometimes move some other blocks. Under Linux such files are fragmented. Perhaps I must preallocate smaller peaces for windows. I will implement an option to control the max prealloc size for experiments to find out an optimal value.
real 7m47.684s user 0m10.179s sys 0m38.757s pool/a.wbfs -> /dev/sdb3 <55257>, 6908/6910 MiB, frag=7816
SUMMARY for Linux + ext3:
The preallocation consumes 88 seconds. The copy only time is in all 4 cases about 6:20. The number of fragments is always about 7800. This means that preallocation has no advantage on linux+ext3. I think, preallocation allocate disc space and fill it with zeros. Btw: fragmentation is not a ext2/ext3 problem because it is designed to handle with fragments.
Last not least the command I used:
Warning! Spoiler inside.
CODE
make test debug all
for i in --sparse --pa-limit=100M --pa-limit=1G --pa-limit=10G; \ do \ echo "########## $i #########"; \ rm -f pool/a.wbfs* pool/.a.wbfs*; \ sync; \ sleep 1; \ time ./wit cp -ovv --psel data srcdir/ssbb.wdf pool/a.wbfs $i; \ ./print-disc-blocks.sh pool/a.wbfs \ done 2>&1 | tee a.log
# 'pool/' is my temp and working dir (it is ignored by svn)
# linux, 64 bit, copy ssbb.wdf to ext3 6902 MiB copied in 6:20, 18.1 MiB/sec no prealloc 6902 MiB copied in 7:38, 15.0 MiB/sec prealloc in chunks a 100 MiB 6902 MiB copied in 7:39, 15.0 MiB/sec prealloc in chunks a 1 GiB 6902 MiB copied in 7:47, 14.8 MiB/sec complete prealloc
CODE
# linux, 64 bit, copy tra.wdf to fat32 3168 MiB copied in 1:28, 35.8 MiB/sec no prealloc 3168 MiB copied in 3:02, 17.4 MiB/sec prealloc in chunks a 100 MiB 3168 MiB copied in 3:02, 17.3 MiB/sec prealloc in chunks a 1 GiB 3168 MiB copied in 3:02, 17.3 MiB/sec complete prealloc
CODE
# linux, 64 bit, copy tra.wdf to ntfs 3168 MiB copied in 0:40, 78.0 MiB/sec no prealloc 3168 MiB copied in 1:15, 41.9 MiB/sec prealloc in chunks a 100 MiB 3168 MiB copied in 1:15, 41.8 MiB/sec prealloc in chunks a 1 GiB 3168 MiB copied in 1:16, 41.5 MiB/sec complete prealloc
CODE
win XP, 32 bit, copy tra.wdf to fat32 3168 MiB copied in 2:22, 22.2 MiB/sec no prealloc 3168 MiB copied in 2:41, 19.6 MiB/sec prealloc in chunks a 100 MiB 3168 MiB copied in 2:17, 23.0 MiB/sec prealloc in chunks a 1 GiB 3168 MiB copied in 2:10, 24.3 MiB/sec complete prealloc
CODE
# win XP, 32 bit, copy tra.wdf to ntfs 3168 MiB copied in 5:54, 8.9 MiB/sec no prealloc 3168 MiB copied in 3:36, 14.7 MiB/sec prealloc in chunks a 100 MiB 3168 MiB copied in 4:17, 12.3 MiB/sec prealloc in chunks a 1 GiB 3168 MiB copied in 4:12, 12.5 MiB/sec complete prealloc
Conclusion:
Preallocation seems only good if windows writes to NTFS.
On linux preallocation slows down the copy operation without any advantage.
If preallocating don't split the preallocation chunks.
Does anyone have tools that shows the number of FAT fragments? In general I'm searching for non interactive tools analyzing the fragmentation for each os+filesystem combi.