Slow read rate
Hello,
I'm trying it using TachiyomiSY (Mihon, comic reader) for the downloaded / local storage chapters, but when trying to open it, it is reading the files very slowly.
Is there a way to understand why is it loading slow, even when a chapter is only 15MB per file/chapter in .cbz. Sometime during scrolling, it take good 10 second to load the next part of the same file.
My SMB disk is SSD, using normal file explorer around 5MBps rw.
Idle timeout 15m0s.
I'd suggest:
- Enabling debug mode by long pressing RSAF's version number
- Enable the
Verbose rclone logsoption - Try to reproduce the problem in TachiyomiSY
- Use the
Save logsoption in RSAF- (Please don't upload the log file without checking for passwords first. rclone's verbose logs might contain login details.)
Inside the log file, you should see a bunch of lines like this:
I/GoLog ( 6646): 2025/02/27 04:38:49 DEBUG : filename: ChunkedReader.Read at 4429180928 length 1048576 chunkOffset 4427087872 chunkSize 8388608
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428136448, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428267520, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428398592, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428529664, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428660736, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428791808, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4428922880, 131072, <data[131072]>)
D/RcloneProvider( 6646): ProxyFd[sm-1-smb:filename].onRead(4429053952, 131072, <data[131072]>)
When an app (TachiyomiSY in your case) reads a file, rclone first fetches a chunk of data from SMB into memory and then the app reads from memory.
The first line in the example above is logged whenever rclone reads data from your SMB server into memory. In my example, it read length 1048576 (1 MiB) from my SMB server.
The other lines are when the app reads a chunk of data. In the onRead(4429053952, 131072 part, the first number is the position of the file and the second number is the number of bytes the app is trying to read. In my example, the app read 131072 bytes 8 times = 1 MiB total. That used up all the data in memory, so rclone will fetch more data from the SMB server the next time the app tries to read.
If it's only slow in TachiyomiSY, but not in the file manager, then I suspect it is trying to read the file in a non-optimal way. For example, these are some common things that could cause things to be slow:
- Reading the file in small chunks
- Reading the file in random order instead of sequentially
- Rereading the same parts of the file repeatedly
The best case scenario for performance is when the file is read beginning to end in large chunks. Copying a file in a file manager is normally like this. With a good Wi-Fi connection, rclone's SMB backend should be able to do 25-30 MiB/s pretty easily.
For tachiyomi forks specifically, there is a feature in komikku[^1] that should solve this: go to settings -> reader, scroll all the way down to the bottom and set archive reader mode to memory[^2] (make sure you're using archives and not saving images directly in files).
[^1]: I know it's in komikku beta and has been for quite a while, not sure about other forks
[^2]: My understanding is that this copies the entire archive into memory vs the default method of opening the archive every time you advance to load the next page into memory. I may be wrong, but if not it should solve the issue at the expense of training longer when you change chapters.
mode to memory
OMG, I instantly noticed the difference after changing this settings. Thank you!
If you need another app that works this way, Perfect Reader used to be my preferred cbz viewer because it has good networking features as it didn't require actually downloading the files locally (though it was pretty bad at cbz files of 100s of mb IIRC, that shouldn't usually be an issue). One of the few free non-foss apps I've paid for over the years and never regretted. Not sure if it's still active, though.