You can see from the title that this is NOT a bug. Please flag it as discussion. Maybe, if we reach some result, you can put it in the Wiki.
Description
I have searched low and high, but could practically find nothing about what ntfs-3g parameters and/or kernel I/O scheduler tunables to use when dealing with SMR (Shingled Magnetic Recording) media. In my situation, the SMR media are 2.5" external USB3 HDDs (not SSDs), encrypted with Truecrypt or Veracrypt. When I try to initially fill such a disk with backups, basically consisting of thousands of small (500K-2M) files, with, say, rsync, the write throughput slows down after the first 10-20 Gigabytes to a crawling 1MB/sec (one _Mega_byte per second)!
System
Gentoo Linux, 5.4.196 kernel, lots of RAM, ntfs3g-2022.10.3.
The guiding idea behind all these settings was: increase file cache, keep the copied files in the cache as long as possible, increase the write batch - in general: write as many bytes as you can in one batch to the drive. The hope was that the more data I would write at once, the more consecutive I/O writes I would send to the drive, increasing the chance that the "zones" (pieces of 256MB consecutive data) would be written sequentially. Remember, the drives may be encrypted, which increases the entropy (data that were neighbors in the source filesystem, will be scattered around randomly). Since the data looks random to the drive, I hoped to gather as many consecutive ones as possible by gathering them in the file cache or a "write batch".
In line with the above considerations I also
mounted the drive(s) with the big_writes mount option of ntfs-3g
tried to increase the commit interval, but found no option analogous to the commit mount option of ext4, or sysctl fs.xfs.xfssyncd_centisecs=XXX for XFS
Nothing worked. While big_writes did write large amounts of data at once, after the first 10, 20 GB, throughput grinded to a halt, with the drive being busy, while rsync stopped sending data, waiting for the drive's O.K. Average write throughput: ~1MB/sec.
At this point I am out of ideas. What would you suggest? Is anything that can be done to increase write performance of drive-managed SMR disks with ntfs-3g?
On a side-note, the above settings do help in an XFS filesystem to increase SMR write performance to anywhere between 10 and 40MB/sec - that's huge compared to 1MB/sec for NTFS!
You can see from the title that this is NOT a bug. Please flag it as discussion. Maybe, if we reach some result, you can put it in the Wiki.
Description
I have searched low and high, but could practically find nothing about what ntfs-3g parameters and/or kernel I/O scheduler tunables to use when dealing with SMR (Shingled Magnetic Recording) media. In my situation, the SMR media are 2.5" external USB3 HDDs (not SSDs), encrypted with Truecrypt or Veracrypt. When I try to initially fill such a disk with backups, basically consisting of thousands of small (500K-2M) files, with, say, rsync, the write throughput slows down after the first 10-20 Gigabytes to a crawling 1MB/sec (one _Mega_byte per second)!
System
Gentoo Linux, 5.4.196 kernel, lots of RAM, ntfs3g-2022.10.3.
Suggestions
Searching around, I found (I should say stumbled, as it was rather by chance - I was searching for "How to increase file cache with ntfs-3g", rather than "Which I/O scheduler tunables to use with ntfs-3g and SMR media", which brings up nothing of interest in my search engine of choice), the following suggestion in Can I configure my Linux system for more aggressive file system caching?:
However, this is not directly applicable in my case: it is for the bfq scheduler, while I have the mq-deadline scheduler.
What I tried
For me the tunables in question were the tunables of mq-deadline:
I have tried to set them to higher values:
I also set the kernel virtual memory management tunables:
The guiding idea behind all these settings was: increase file cache, keep the copied files in the cache as long as possible, increase the write batch - in general: write as many bytes as you can in one batch to the drive. The hope was that the more data I would write at once, the more consecutive I/O writes I would send to the drive, increasing the chance that the "zones" (pieces of 256MB consecutive data) would be written sequentially. Remember, the drives may be encrypted, which increases the entropy (data that were neighbors in the source filesystem, will be scattered around randomly). Since the data looks random to the drive, I hoped to gather as many consecutive ones as possible by gathering them in the file cache or a "write batch".
In line with the above considerations I also
big_writes
mount option of ntfs-3gcommit
mount option of ext4, orsysctl fs.xfs.xfssyncd_centisecs=XXX
for XFSNothing worked. While
big_writes
did write large amounts of data at once, after the first 10, 20 GB, throughput grinded to a halt, with the drive being busy, while rsync stopped sending data, waiting for the drive's O.K. Average write throughput: ~1MB/sec.At this point I am out of ideas. What would you suggest? Is anything that can be done to increase write performance of drive-managed SMR disks with ntfs-3g?