NTFS Performance Enhancement on DiskStation

Hi, I’m Eric Chang, a software engineer in Synology’s Research & Development team. I’m here today to share with you the enhancements about NTFS performance we have made.

Accessing NTFS files in DiskStation

I’ve got a DS211+ in my place in Taipei, and it works as my private cloud that stores my family’s and my own data. When I return to my parents’ place for holiday, I often take some movies and music that I find entertaining to share with them. The multimedia files are copied from DS211+ to an external hard disk, which uses NTFS file system. I usually use File Station to transfer data, the files are moving between 2 different file systems – EXT4 and NTFS. Copying a 5GB size movie from DiskStation to the external hard disk takes about 5 to 6 minutes, which means if I were to take 10 movies with me, I’d need to reserve 1 hour to have the files copied to the external disk. This is perfectly fine if time allows and if you are the patient, but I believe the majority of us prefer not to wait that long.

If you take a new external hard disk, plug it into DiskStation and have the external hard disk formatted to EXT4 file system, the writing speed can be more than doubled. But most Windows users prefer to use a NTFS external hard disk so it can be recognized by DiskStation and Windows operating system. Therefore, in DSM 4.0, significant improvement was made to NTFS writing performance.

Accessing NTFS file in Linux environment

Before I head into explaining the improvements we did, let’s first understand how a NTFS file can be accessed in Linux environment. Linux kernel first started supporting NTFS file system in 1990s in linux-ntfs-org, which is a Linux-NTFS project. The built-in module in Linux kernel was only able to mount read-only NTFS files. In 2006, Szabolcs Szakacsits, one of the developers of Linux-NTFS, launched another stand-alone project called NTFS-3g. This is an application that’s not tied to the operating system and can be used to mount NTFS file systems. On Linux platform, NTFS-3g is a user space file system that’s based on FUSE (File system in User space). Traditionally, file systems are constructed based on kernel space module. When user makes a request, the command is first converted into system call and then executed by kernel space file system.

After Linux 2.6.14 was released, FUSE is used as the basis to support user space file system to ensure the stability of kernel. As a kernel module, FUSE receives system call that’s generated from user’s file system request. FUSE then passes the command to the file system in user space. FUSE makes it possible for users to develop operating system without editing kernel code and elevates the operating system’s support on new file system. However, the context switch between kernels space and user space along with data transfer drag down performance. The following image illustrates the operating procedure of such user space file systems.

Print

User space file system NTFS-3g are constructed on FUSE. /mnt is the NTFS mount point. User space shell command, “ls -al /mnt”, sends a request to VFS, which passes to FUSE kernel module and sends it to NTFS-3g in user space file system. The response is sent back in the reverse direction. Within this round command, there have been 4 context switch occurrences between user space and kernel space. System performance is affected by the number of times context switch occurs. When context switch happens more often, the performance drops.

While NTFS-3g is integrated into DiskStation as the module to access NTFS file system, the performance is limited by FUSE architecture. The issue is very significant when data is written from Disk Station onto NTFS external hard disks.

NTFS Enhancement in DSM 4.0

One of the golden rules in Synology is performance deliverance. Therefore, we made several researches to the NTFS performance issue. We compared the behavior between different systems and recorded the performance of NTFS external hard disk on different platforms. In the end, what was in front of us was a list of different possibilities that may lead us to accelerate NTFS performance. After more brainstorming, research, testing, and confirmation, the data write-in performance to NTFS external hard disk more than doubled in DSM 4.0.

Let’s get down to the figures. The following is the test record on the NTFS performance on 3 different DiskStation models. Each platform was tested before and after DSM 4.0 release. Before is the test result.

image

image

image

The test environment is:

  • CPU: Intel Core i5; RAM: Kingston 2GB DDR3 1800 x 2; NIC: Intel Gigabit CT (PCIe)
  • OS Hard disk: Seagate ST31000528AS 1TB; Windows 7
    Data hard disk: SSD SVP200S3 60GB x2, RAID 0
  • Connected to RAIDON GT1650-SB3 USB3.0/ESATA 3.5 via eSATA interface

We compared the performance difference on DS212+, DS712+ and DS1512+. On each DiskStation model, we copied a large file (5GB x1) and a batch of small files (1MB x5,000) from DiskStation to NTFS external hard disk. Files are transferred via samba protocol. As you can see from the charts above, the performance is significantly improved on all platforms. The large file performance of DS1512+ boosted from 40MB/s to 110MB/s. We also observed a 270% performance growth on DS212+.

Conclusion

When accessing NTFS file system based on FUSE architecture in Linux, the performance is affected by context switch that happens between user space and kernel space. DSM 4.0 is able to significantly increase the write-in performance from DiskStation to NTFS file system, without changing the architecture. It’s just another proof that we are continuously advancing, moving forward at all times. This also shows our unchanged commitment in delivering better performance and services to users continuously.