Reading data created by Transmission very slow

Status
Not open for further replies.

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442
Hey all, new user here, but I went as far as I could for this problem.

I have transmission/sonarr set up in jails, saving files in a folder called Downloads. The problem is that whenever I copy data from Downloads created by transmission, i get between 20-40MBps. If i create a file via smb or dd in the same folder, then copy it off the NAS via SMB, i get 300-400MB (via 10gb link to nvme drive). If create a file via dd or smb in the Downloads folder, then copy it to another dataset via terminal i get at least 80MBps, so at least 4x faster.

I noticed during these copies that the disk busy hits 100%, similar to if I was doing random reads, however, the files are 3-4GB in size so I would expect them to be laid out sequentially. Is it possible that either the jail (warden still), transmission, or sonarr is writing the file non-sequentially?

usr/bin/time -h dd if=/dev/random of=sometestfile bs=1G count=40 within the jail itself to the media folder (linked to Downloads) still gives me 150MBps even though CPU spikes very high.

Testing is done via 10GB link via smb, as well as copy's between one dataset to another via cp command via ssh and times using /usr/bin/time -h.

Specs for NAS:
Celeron G3930
16GB memory (non-ECC don't yell at me)
6X 4TB Seagate NAS drives in RAIDZ1 single vdev.
 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
This is normal behavior. Those file pieces are typically downloaded completely out-of-order. That means they are not contiguous on disk. When you try to read the entire file in order, it must seek out all the pieces.

One way to work around this is to have the files download to non-ZFS storage, and then copy to ZFS storage upon completion. If that isn't possible, just doing a copy within ZFS will clear it up.

Some clients are able to hang on to writes until they are a certain size so they are less random.
 

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442
rs255, thank you for responding! That's pretty much what I was guessing, but it makes me feel a lot better knowing I didn't mis-configure something. Just out of curiosity, why are they written to disk out of order in that circumstance? Is it because they are torrents being downloaded in multiple pieces and written to disk at different times? If I had this on another system writing to the NAS via smb (instead of locally on a jail) would that change the behavior?

When you say "doing a copy within ZFS", are you talk about literally just copying and pasting (or moving) the files from one place to another? Could you give an example?

Thanks again!
 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
Yes, you are correct. Writing it over SMB would be just as slow, unless it saves locally and only moves to SMB after completion.

Making a copy has to be a copy. Moving is usually not a copy. In Windows, if you right click the folder (named Example) and select copy, then right click below in empty space and select Paste, Windows will usually create a copy of the folder called "Example - Copy". You could then rename Example to Example.original and then rename "Example - Copy" to Example. Once you know Example is a correct copy, you can delete Example.original.

Access times of the copied version will be fast.
 

nahum

Cadet
Joined
Apr 24, 2015
Messages
1
If you create a dataset just for downloads then have transmission move it to another dataset (say completed) when it completes the download it will accomplish two things. First the files will be mostly contiguous after copying them over. Secondly you will minimize fragmentation on your pool because you will keep the download dataset small and empty. I believe that one of the Lucas/Jude ZFS books mentioned this.
 

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442
Thanks nahum! That seems to have done the trick. I hadn't realized I could specify the multiple locations like that.
 
Status
Not open for further replies.
Top