NTFS compression is terrible for many small files

Don’t use NTFS compression for many small files.

I recently tried to enable NTFS compression on some log files to see how the compression ratio would fare versus batch compressing them all. I experimented with a 64MB folder with ~10k files and noticed a 1.4GB increase in disk usage. Interesting… let’s take a look.

Pre-compression:

ntfs-comp-1

 

Folder properties:

ntfs-comp-2

 

 

Applying compression attribute:

ntfs-comp-3

 

Post-compression:

ntfs-comp-5

 

 

Nice, a 30% compression ratio (64MB to 45MB). Considering that each file is typically 1-4KB, I thought this was reasonable (compared to the batch compression ratio of 10:1). But, I noticed an odd increase in disk usage:

 

ntfs-comp-4

 

2.6GB down to 1.2GB. The only action taken was enabling NTFS compression on the above folder. Removing the compression attribute restores the lost 1.4GB of disk space.

 

This is surprising for two reasons: NTFS compression is supposed to be beneficial for small files (4-64KB) 1, and the folder properties don’t alert the user to any extreme loss of disk space.

 

Notes:

  1. http://en.wikipedia.org/wiki/NTFS#File_compression

Leave a Reply