Write cache overload on qBittorrent

Hello everyone, I have a issue with qBittorrent on OrangePi 4B when I download to NAS.

This is my fstab:

192.168.31.xxx:/xxx /mnt/nfs_client nfs w,async,tcp,noatime,rsize=10485766,wsize=1048576,hard,timeo=600,vers=3,\_netdev,x-systemd.device-timeout=120,x-systemd.automount 0 0

I tried to connect it trough Samba protocol but is doing the same, it starts downloading at 20MB/s and then it lowers to 50kb/s - I noticed that everytime this happens write cache overload is 90%

I saw this qBittorrent download very slow - #37 by KamikazeePL on the forum, but didn’t work for me.

I noticed that is only write speed which is affected, cause when I try to read from the disk is ok - disks are fine, cause on Windows with Samba is getting 30MB/s stable.

Do you have any idea what can be the issue here?

Since it’s working with windows (Downloading on win and write to NAS) the OrangPi is maybe the bottleneck.

Can you check with htop the cpu utization and how much RAM is used. Maybe the bottleneck is there.

I would also stick to NFS and try to force it to use NFSv4 (if supported by your NAS)
You can also limit the number of parallel downloads to get rid of a high amount of parallel writes, maybe this is helping.

Also ChatGPT ( :sweat_smile:) says, your rsize/wsize=1048576 is very high and it recommends rsize=32768,wsize=32768 or at max 128k (maybe doublecheck this idea)

Does the speed stays high when you download to a local storage on the OPi?

Hi, thanks for your reply, will try what ChatGPT told you

Here is htop while write cache is 80% doesn’t look like bottleneck.

How do you limit the paralel downloads?

Ok so the CPU is not limiting, but your write cache is already 80% full, so qbittorrent will slow down the downloads already. Your load avg is also around 9, so a lot of processes are waiting for I/O. (probably bc the writes of qbittorent clocking up the system)
You don’t have this problem on windows, bc windows is buffering massively into RAM, collecting the files into a big chunk before sending them via SMB. Linux does not do this, it handles it different to achieve better data consistency.

Just download one or two torrents at the same time to reduce the amount random writes.

You could also download the files first to local storage on the OPi and when finished transfer them to the NAS (There is an option Keep incomplete torrents in:”), so you don’t have so many random writes on the NAS.