Rclone serve dlna - Performance Issues

What is the problem you are having with rclone?

Hello,

Have been using rclone and the serve dlna function to serve audio from my router to various LAN clients with minimal success. Though initially functional\stable after a seemingly random period of time from the client side the audio playback is halted and the clients will eventually throw connection\timeout errors. From the server side what appers to be happening is the rclone process is driving up the load to the point of unresponsiveness both server and client side.

What is your rclone version (output from rclone version)

Have tested with both versions v1.53.0 and the latest beta:

rclone v1.53.0

  • os/arch: linux/mipsle
  • go version: go1.15

rclone v1.57.0-beta.5681.fbc7f2e61

  • os/version: openwrt 21.02.0-rc4
  • os/kernel: 5.4.137 (mips)
  • os/type: linux
  • os/arch: mipsle
  • go/version: go1.17.1
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

256GB USB 3.0 flash drive attached to single USB 2.0 port on router using F2FS file system on single partition

The command you were trying to run (eg rclone copy /tmp remote:tmp)

./rclone serve dlna audio/ --read-only --name SERVER1 -vv

The rclone config contents with secrets removed.

Not using config file, command line options only.

A log from the command with the -vv flag

2021/10/02 19:41:34 INFO  : /ctl: 10.20.30.44:60110 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:41:38 DEBUG : Eiffel 65/Europop (1999) [FLAC]/06 - Eiffel 65 - My Console .flac: ChunkedReader.Read at 25161728 length 1048576 chunkOffset 0 chunkSize 134217728
2021/10/02 19:41:39 DEBUG : Eiffel 65/Europop (1999) [FLAC]/06 - Eiffel 65 - My Console .flac: ChunkedReader.Read at 26210304 length 1048576 chunkOffset 0 chunkSize 134217728
2021/10/02 19:41:41 DEBUG : Eiffel 65/Europop (1999) [FLAC]/06 - Eiffel 65 - My Console .flac: ChunkedReader.Read at 27258880 length 1048576 chunkOffset 0 chunkSize 134217728
2021/10/02 19:41:42 DEBUG : Eiffel 65/Europop (1999) [FLAC]/06 - Eiffel 65 - My Console .flac: ChunkedReader.Read at 28307456 length 1048576 chunkOffset 0 chunkSize 134217728
2021/10/02 19:41:44 DEBUG : Eiffel 65/Europop (1999) [FLAC]/06 - Eiffel 65 - My Console .flac: ChunkedReader.Read at 29356032 length 1048576 chunkOffset 0 chunkSize 134217728
2021/10/02 19:41:46 INFO  : /ctl: 10.20.30.44:60110 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:41:54 INFO  : /ctl: 10.20.30.44:60110 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:41:56 INFO  : /ctl: 10.20.30.44:60110 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:42:09 INFO  : /ctl: 10.20.30.44:60118 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:42:09 INFO  : /ctl: 10.20.30.44:60117 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:42:09 INFO  : /ctl: 10.20.30.44:60119 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/02 19:42:09 INFO  : /ctl: 10.20.30.44:60120 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"

It is at this point where the audio playback client side halts and the rclone process on the server\router drives up the load. I have tried with various --dir-cache-time, --vfs-read-chunk-size, --vfs-read-chunk-size-limit and --buffer-size options\values and they only seem to make things worse\more unstable where the audio playback is interrupted sooner (can't even get through a single song) and the the load spikes.

My audio directory contains 6309 FLAC files in roughly 242 sub-directories (max sub-directory depth likely doesn't exceed 3, typically Artist > Album but may also contain a Disc sub-directory in the parent Album directory), file sizes are on average between 20-60MB.

Any tips\pointers to smooth things out would be appreciated.

hello and welcome to the forum,

  • can you post the entire log or at least top 30 lines of the debug log?
  • are there any errors in the debug log?
  • have you tried to use different clients on different devices?

I have generated a debug log file using the following command:

./rclone serve dlna audio/ --read-only --name SERVER1 --log-file=debug.log --log-level=DEBUG

The entire log file is here:

I don't see any explicit errors in the log file myself. In the log file example I started the server, navigated to the artist and album directory and played a single song (which played through successfully) before the client choked and the load on the server spiked to the point where I had to kill the rclone process.

My primary client is my phone (iPhone) using the Flacbox application but issue persists from my computer as well using VLC.

Thanks

how much ram does the router have, that could be an issue.
i would watch that very closely.
might try --buffer-size=0 --use-mmap

and only play one stream at a time

fwiw, i got tired of my openwrt flashed onto a linksys wrt3200acm and trying to use it for anything other than a router. always running into lack of ram issues
so i got a cheap raspberry pi....

The router has 128MB of RAM and I am only playing a single stream from a single client at a time.

Will test now with the additional parameters and see what happens. I have a Raspberry Pi Zero that is doing nothing at the moment but would much prefer to have the router serve the audio versus adding another client on the LAN.

i have a pi zero, rclone runs well on it and 512MB is workable.
on that piz, if my internal memory serves me, minidlna ran well

I am in the situation now where I should have setup ExtRoot on the router to begin with as I am now out of space on the internal flash to test either Samba or try minidlna again. I tried minidlna initially and did not like the way the clients displayed the folder structure and file names, this is what lead me to rclone.

I also have nfs setup on the router and it works wonderfully from my computer but I can't find an iOS application that will support it.

So far with --buffer-size=0 --use-mmap things are much better, 4 songs played in a row without issue, able to navigate through the folder structure just fine.

You also might want to add export GOGC=20 to the environment - this will cause the garbage collector to try harder. (From rclone using too much memory)

Utilizing --buffer-size=0, --use-mmap and having added GOGC=20 to my environment everything is nice and stable, have had no connectivity or performance issues.

Thank you both @asdffdsa and @ncw for the help\insight.

1 Like

good to know that rclone serve can run in a router having just 128MB.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.