VTrakFS file system has following built in anti-fragment allocation algorithm that helps minimize file fragmentation
Allocation by Resource Group:
Each LUN/RAID LD in segmented into large equal size chunks called Resource Group (RG). During file creation, each file is assigned to a different RG. By virtually separating files into different RG, interleaving of file’s data is reduced considerably thereby minimizing fragmentation.
Allocation by Goal:
As a file is written, the file system instead of searching for free blocks randomly, will start its search for free blocks starting from the file’s previously allocated block (the goal) so that new data is placed nearby to the previous write. In most of the cases, allocation of the new block happens adjacent to the previous one. This technique minimizes fragmentation of the file.
Pre-Allocation:
The file system considers files with a large size are more likely to become larger. The built in algorithm triggers for large file offset and pre-allocate blocks based on the file offset of the write command predicting that these pre-allocated blocks will be used for subsequent writes. This technique helps reduce fragmentation for large files. The aggressiveness of the pre-allocation can be tuned using knobs provided.
Unlike Pre-Allocation technique which help large file, this technique helps medium size files. Reservation window is a mechanism similar to pre-allocation by reserving free blocks for a file. They are different in that, reservation window only reserves blocks in memory and can be revoked when the filesystem is really short of free blocks. As blocks are reserved preventing other files from allocating them, this helps minimize fragmentation. Knobs are provided to tune the size of reservation windows.
Resource Group by Parent:
DPX format is used to store a single frame of a video stream. Multiple DPX files are used to store sequences of frames making the entire video stream. So DPX files are highly related to each other and they should be sequentially arranged on the storage. If they are separated from each other, they are fragmented on the inter file level. This technique helps address this issue by allocating DPX files in the same directory to be placed in the same Resource Group so that files are contiguously placed.