Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow read rate #134

Open
aqsede opened this issue Feb 27, 2025 · 1 comment
Open

Slow read rate #134

aqsede opened this issue Feb 27, 2025 · 1 comment
Assignees

Comments

@aqsede
Copy link

aqsede commented Feb 27, 2025

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.

@chenxiaolong
Copy link
Owner

I'd suggest:

  1. Enabling debug mode by long pressing RSAF's version number
  2. Enable the Verbose rclone logs option
  3. Try to reproduce the problem in TachiyomiSY
  4. Use the Save logs option 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.

@chenxiaolong chenxiaolong self-assigned this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants