What happens
On Windows, while downloading a multi-file torrent, my disk gets almost as much read traffic as write traffic, even though I'm only downloading. The reads are on the very files that are being written at that moment.
This happens with libtorrent 2.1.1. With a libtorrent 1.2 based build, the same torrent on the same drive with the same settings produced only about a fifth of the disk reads.
Downloading at about 50 MB/s, Resource Monitor (Disk tab) shows:
| Process |
Read |
Write |
| qbittorrent.exe |
38.1 MB/s |
0 |
| System |
0 |
35.8 MB/s |
Per file, for the torrent being downloaded:
| File |
Read |
Write |
Read / Write |
| 1 |
31.8 MB/s |
24.9 MB/s |
1.27 |
| 2 |
6.4 MB/s |
5.5 MB/s |
1.16 |
| 3 |
0 |
5.3 MB/s |
- |
These are real disk reads, not cache hits — the drive sat at 88% active time.
My upload rate was low at the time, so this isn't seeding traffic.
Environment
- Tested with a qBittorrent 5.3.0alpha1 GitHub Actions build using libtorrent 2.1.1
- OS cache enabled for both read and write, disk queue size 100 MiB, pread/pwrite disk IO type
- Windows 11, NTFS with 4 KiB clusters, HDD
- "Pre-allocate disk space for all files" enabled
- Running qBittorrent as administrator, so
SetFileValidData() succeeds
Workaround
Turning off "Pre-allocate disk space for all files" so the files are created sparse, and no longer starting qBittorrent as administrator, means SetFileValidData() is never used. With that, the reads almost completely disappear at the same download speed.
With libtorrent 1.2 this was fine as it was.
What happens
On Windows, while downloading a multi-file torrent, my disk gets almost as much read traffic as write traffic, even though I'm only downloading. The reads are on the very files that are being written at that moment.
This happens with libtorrent 2.1.1. With a libtorrent 1.2 based build, the same torrent on the same drive with the same settings produced only about a fifth of the disk reads.
Downloading at about 50 MB/s, Resource Monitor (Disk tab) shows:
Per file, for the torrent being downloaded:
These are real disk reads, not cache hits — the drive sat at 88% active time.
My upload rate was low at the time, so this isn't seeding traffic.
Environment
SetFileValidData()succeedsWorkaround
Turning off "Pre-allocate disk space for all files" so the files are created sparse, and no longer starting qBittorrent as administrator, means
SetFileValidData()is never used. With that, the reads almost completely disappear at the same download speed.With libtorrent 1.2 this was fine as it was.