Skip to contentSkip to conversation

VFAT truncate performance

DISCUSSION Mattias Rönnblom 3 participants 4 messages Sep 5, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

extending files by ftruncate(2) runs very slow on VFAT file systems. On my USB harddisk w/ VFAT, it takes 14 seconds to extend an empty file to 1 GB. On a memory stick, it takes well over 4 minutes.

My question is: is this problem on the conceptual level (ie there is no way of extending files on FAT that doesn't involve many disk operations) or is the current Linux fs driver suboptimal in this respect?

The reason for asking is that I run Samba which service files on USB devices (w/ VFAT for portability) to Windows XP clients. When copying files to the Samba server, Microsoft SMB clients seem to extend the file before actually starting to copy the data. This results in sluggishness and timeouts when copying large files to VFAT filesystems.

Thanks,
Mattias

#1 lore raw
Quoted 11 lines · Mattias Rönnblom

Hi,

extending files by ftruncate(2) runs very slow on VFAT file systems. On my USB harddisk w/ VFAT, it takes 14 seconds to extend an empty file to 1 GB. On a memory stick, it takes well over 4 minutes.

My question is: is this problem on the conceptual level (ie there is no way of extending files on FAT that doesn't involve many disk operations) or is the current Linux fs driver suboptimal in this respect?

Quoted 6 lines

The reason for asking is that I run Samba which service files on USB devices (w/ VFAT for portability) to Windows XP clients. When copying files to the Samba server, Microsoft SMB clients seem to extend the file before actually starting to copy the data. This results in sluggishness and timeouts when copying large files to VFAT filesystems.

Is your USB stick mounted -o sync ? If that's the case, the truncate() and write() won't be merged so they will take twice as long. -o sync generally kills performance on USB sticks.

Xav

#2 lore raw
Quoted 19 lines · Xavier Bestel
Quoted 11 lines · Mattias Rönnblom

Hi,

extending files by ftruncate(2) runs very slow on VFAT file systems. On my USB harddisk w/ VFAT, it takes 14 seconds to extend an empty file to 1 GB. On a memory stick, it takes well over 4 minutes.

My question is: is this problem on the conceptual level (ie there is no way of extending files on FAT that doesn't involve many disk operations) or is the current Linux fs driver suboptimal in this respect?

Quoted 6 lines

The reason for asking is that I run Samba which service files on USB devices (w/ VFAT for portability) to Windows XP clients. When copying files to the Samba server, Microsoft SMB clients seem to extend the file before actually starting to copy the data. This results in sluggishness and timeouts when copying large files to VFAT filesystems.

Quoted 4 lines

Is your USB stick mounted -o sync ? If that's the case, the truncate() and write() won't be merged so they will take twice as long. -o sync generally kills performance on USB sticks.

No, 'async'.

Regards,
Mattias

#3 lore raw
In reply to Mattias Rönnblom
Quoted 8 lines · Mattias Rönnblom

extending files by ftruncate(2) runs very slow on VFAT file systems. On my USB harddisk w/ VFAT, it takes 14 seconds to extend an empty file to 1 GB. On a memory stick, it takes well over 4 minutes.

My question is: is this problem on the conceptual level (ie there is no way of extending files on FAT that doesn't involve many disk operations) or is the current Linux fs driver suboptimal in this respect?

Unfortunately FAT doesn't support sparse file, so ftruncate(2) which extend size needs to fill all clusters with zero, and write data.

This is limitation of FAT filesystem.

Signature · 1 line
OGAWA Hirofumi <[email protected]>