Server Version#: 1.28.0.5999 on Linux (Ubuntu 22.04 LTS)
Player Version#: 8.7.1 on iOS 15.16
I searched and couldn’t find any similar issues, but apologies in advance in case I’ve missed something.
Background/Context:
I’ve been unable to successfully download music to my iPhone Plex application since the change over from sync to downloads and finally got around troubleshooting the problem properly. I believed initially that the problem was that the application couldn’t download any music and would hang, though this proved to be incorrect…
Searching to see what problems others have had, it seems a lot of people had issues with DNS rebinding or other network connectivity issues. I quickly eliminated these from the problem:
- I have long since had DNS rebinding permitted on pfSense for “plex.direct”
- I enabled NAT reflection for good measure. I did actually see in the client’s log files that it was trying to connect via the WAN IP address (i.e. connecting to https://w.x.y.z:port/, not using DNS), so this is probably a good thing but didn’t help with this problem.
- A DNS look up on the plex.direct address gives me the correct RFC 1918 IP address for my Plex server.
- I can connect to the plex server in Safari using the plex.direct address.
- Downloads work on Plexamp on my iPhone and on the Plex app for Mac, although the code may be different so this doesn’t necessarily prove anything.
I ran a packet trace on my plex server and found that even when the application looked frozen, it was talking furiously with the server. From there I realised that the application was connected and downloading, but was waiting on slow transcoding.
Issue Synopsis:
Plex downloads on the iPhone Plex app were unusable due to slow transcoding. In one example, transcoding a single 9-10 minute aiff file to ogg took well over 30 minutes to complete. The download itself progressed in lock step with the transcode, and it is quick for files such as mp3 that do not require transcoding.
Actually, when starting a new sync, a handful of songs do download quickly before it starts to slow down, at which point the Plex Media Server log notes that the transcoder is going into an aptly named “sloth mode”:
Aug 10, 2022 16:55:50.566 [0x7f9483896b38] DEBUG - [Req#dbb72] [Transcoder] Throttle - Going into sloth mode.
It’s worth noting that there was no resource constraints on my plex server. CPU utilisation was < 1%, memory utilisation about 60%, no measurable IO wait, load <0.0. The plex server is a VM, but the underlying physical host was equally bored.
I have a lot of AIFF and FLAC in my library, meaning weeks to download my music library (I didn’t actually measure FLAC transcoding time so I’m only assuming it would be a problem as well).
Workaround:
In the Plex server Settings > Transcoder, I changed the “Maximum simultaneous video transcode” from 4 to Unlimited. Changing this setting seems to stop the throttling that was going on. After changing this one setting, aiff to ogg transcoding now takes 10-30 seconds instead of over 30 minutes and the log message “Going into sloth mode” no longer appears.
Please note that despite the name of the setting:
- Plex only transcodes and downloads two songs simultaneously regardless of what I set this parameter to (this is reasonable and I’m happy with that behaviour). The setting avoids throttling, it’s not providing parallelisation.
- I’m not actually downloading or transcoding video in this case - it’s just audio music files.