I was trying to test with a few fuse flags to see what they did and wasn’t having much luck in passing them.
I tried:
-o auto_cache \
and got:
2018/07/09 12:05:13 ERROR : -o/--option not supported with this FUSE backend
2018/07/09 12:05:13 ERROR : --fuse-flag not supported with this FUSE backend
Yes the default fuse backend doesn’t supprort options under linux.
However if you compile from source with go build -tags cmount then rclone will gain another command called rclone cmount which behaves identically to mount, except it does use the fuse library directly. That is how mount is implemented on Windows.
The chunkedReaders really don’t seem to cause any time as the reads all happen within the same second, albeit a lot of calls.
I’m trying to understand the difference between the VFS and the Cache read of the file as the same operation in cache takes 7-8 seconds for a mediainfo, while the VFS read of the same file is 2.5 seconds.
It seems like the larger chunk-size accompanied with more workers, makes the problem worse as all the workers spawn a request to get their data and it waits for the chunks to get downloaded.
I was testing with a single worker and to get roughly 3 chunks and a partial one at 10M chunk size, it took me almost 4 full seconds for at most 40MB of data.
I can’t see anything wrong in the logs.
But they are a good summary of many features used in the VFS layer
What you are observing in this log is the “slow start” behavior of --buffer-size.
In memory buffering is implemented in AsyncReader. It is currently using 1M blocks of memory.
A block can only be filled or consumed at a time. To avoid waiting for a full 1M block to be filled when opening a file, AsyncReader will only write 4k into the first block and allow it to be read as fast as possible. AsyncReader doubles this value for each block, until the max of 1M is reached.
When the “slow start” phase is done, you should only see ChunkedReader.Read logs of length 1048576.
The ChunkedReader.Read logging is a bit to verbose and maybe confusing. I will explain the individual fields:
ChunkedReader.Read at 30670848 length 131072 chunkOffset 0 chunkSize -1
at 30670848 is the absolute byte offset in the file from the beginning. This is the first byte read by this call (0 based).
length 131072 is the length in bytes of the buffer given to the Read function. Read will fill the buffer completely, unless an error occurs or EOF is reached. When --buffer-size 0 is set, this number comes from the kernel and is probably dependent on the --max-read-ahead value which is 128k by default (128×1024=131072). Otherwise the buffer comes from a AsyncReader which is implementing --buffer-size and can be up to 1M in size.
chunkOffset 0 is the absolute byte offset in the file of the currently processed chunk. This number is redundant and could be removed. This is the same value as the at value in the last ChunkedReader.openRange at %d length %d message.
chunkSize -1 is the length in bytes of the currently processed chunk. A value of -1 means chunked reading is disabled (--vfs-read-chunk-size 0). This is the number which shows chunk growth and will increase up to --vfs-read-chunk-size-limit.
The amount of read calls in the second log is normal and is originating from the kernel FUSE handling.
Based on this log I guess --vfs-read-chunk-size 0 and --buffer-size 0 were used. Using this combination you get the most direct path from the kernel to the cache backend.
Using a small --buffer-size of 2M (1M could have waiting issues because there is only one block for reading and writing, but I din’t verify this) maybe helps with the chunk retry storage messages, but I don’t know what they really mean.
What I was noticing on the workers is that they all seem to try to grab a chunk at the same time so if the worker count is high, it slows down the overall process as they are all competing for the chunks.
I was able to set the vfs-read-chunk-size and that did show up properly in the debug as the length.
I tried playing around with a lot of the values, but wasn’t able to make any material change in the mediainfo of a file as it still takes anywhere from 5-10 seconds.
I just don’t understand why it takes a second or two to pull down a 32MB chunk.