Server transcoding extremely slowly

Server Version#: 1.16.6.1592
Player Version#: 4.6.4

CPU: AMD Athlon II X4 620 Processor
RAM: 4.0 gb
Storage: 120gb SSD (root); 1tb HDD (media)
OS: Ubuntu 18.04

I’m entirely unable to figure out why this server is serving video up so slowly. It was working fine up until a few weeks ago when its ability to transcode video seems to have gone down the tube. I’ve tried rolling versions back to no avail so I don’t think it’s got to do with that.

What’s basically happening is that anytime I attempt to play a movie it sits and spins, serving up a few frames every few minutes. I’ve been running Plex on this server for years with absolutely zero problems or complaints to speak of. Not really sure what’s going on.

I know the hardware is a bit old, but as I said above - it’s worked without issue for years. The only recent “big” change to speak of was a recent upgrade to Ubuntu 18.04 from 16.04 after several older disks died and I picked up some new ones. However, after the upgrade the server ran fine, serving up video with no problems from April/May until probably the last couple months.

The CPU is 10 years old.

Ubuntu 18.04 is a big update with a lot more overhead.

The Passmark rating for that CPU only 2929. NAS boxes have more CPU power (almost 2x)
https://www.cpubenchmark.net/cpu.php?cpu=AMD+Athlon+II+X4+620&id=166

Another possibility is you’ve increased the processing demand with your video files.

Without detailed analysis, it’s tough to come to more exact answer but it really is time to let the CPU go.

That’s what my thought was going into this post, but wanted to be sure. I’ve picked up an AMD FX-8120 and plan on rebuilding this week sometime. Hopefully this new processor does the trick, it’s benchmark is definitely better.

If you’re going to do this, I would strongly recommend taking the extra step.

https://www.cpubenchmark.net/cpu.php?cpu=AMD+FX-8120+Eight-Core&id=261

This is only 6000 passmarks. I have a 2012 i7-3470 quad mobile which is 30% faster than that.

Grab a Ryzen if you’re going to do it. Get the biggest bang for your buck.

I got the processor on Craigslist for $100 and it came with the mobo needed and 16gb of RAM, definitely far cheaper than what you’re suggesting.

Also, who buys a Ryzen for a media server? That seems like absolute overkill considering I have maybe 5 people using this server on a regular basis.

Should that $100 CPU and Mobo not do the job, please remember that we did advise you and offered a solution which would last for 3-5 years into the future at minimum but, you’re right, the final choice is yours to make.

Best of luck.

FYI: You will likely be surprised how many people buy Ryzen and Xeon processors for their media servers. How silly is it to have an i7-7700 CPU in his NAS ?? I do and it wears a lot of hats in a very small footprint.

I have a similar issue. But in my case I have two Intel Xeon CPU E5-2640 v3.

OS: Ubuntu 16.04 LTS
CPU: 2x Intel Xeon CPU E5-2640 v3 (32 Cores)
RAM: 8GB DDR4
Internet: 1gbps/700mbps
Client: Chrome, Roku, Plex App (Windows), Android

I tried to optimize the database via the UI, I tried with the shell. My old 8 cores server was running much more smoother. The current log should show a remote play from chrome.

If you could help me, that would be much appreciated. Also, if you need more info, just tell me :slight_smile:

Plex Media Server Logs_2019-09-24_15-16-41.zip (2.2 MB)

Would you please recreate the problem and keep ALL the files in the ZIP file.
Based on what I see, it looks like you removed the other rollover files?

I recreated the problem. The zip is as is. I took from the troubleshooting page. Sometimes the transcoder goes really fast and sometimes like in this case, the transcoder speed does not go higher than 0.6. So after 2-3 minutes, the movie start buffering.

EDIT: Ubuntu is running on a VM

Plex Media Server Logs_2019-09-24_16-53-10.zip (3.1 MB)

I see the problem… thanks for the logs.

Sep 24, 2019 16:48:48.706 [0x7f6fbaffd700] DEBUG - Scaled up video bitrate to 4653Kbps based on 4.500000x fudge factor.
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: Selected protocol dash; container: mp4
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: analyzing media item 395047
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: Direct Play is disabled
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: media must be transcoded in order to use the dash protocol
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: no direct play video profile exists for http/mkv/hevc
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: no direct play video profile exists for http/mkv/hevc/ac3
Sep 24, 2019 16:48:48.707 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: no direct play video profile exists for http/mkv/hevc/ac3
Sep 24, 2019 16:48:48.708 [0x7f6fbaffd700] DEBUG - MDE: E14 - Woodland Critter Christmas: no remuxable profile found, so video stream will be transcoded

It is going to transcode HEVC. There is no hardware assist,

https://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+E5-2640+v3+%40+2.60GHz&id=2365

It does have 13,000 total passmark if all the cores were used (which they won’t be). It must also perform Subtitle burning. (Web player does not support subtitles without burning – French selected)

Sep 24, 2019 16:48:39.673 [0x7f6f60ff9700] DEBUG - TPU: hardware transcoding: zero-copy support not present
Sep 24, 2019 16:48:39.674 [0x7f6f60ff9700] DEBUG - Job running: EAE_ROOT='/tmp/pms-70059d6e-cf4c-480b-9ca5-578fb9c4bbcd/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/dd95667-2450-linux-x86_64/' XDG_CACHE_HOME='/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-codec:1' 'ac3' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' 'http://127.0.0.1:32400/library/parts/432916/1564425787/file.mkv?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx' '-filter_complex' '[0:0]scale=w=1920:h=1080[0];[0]format=pix_fmts=yuv420p|nv12[1]' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':osr=48000[2]' '-map' '[1]' '-codec:0' 'libx264' '-crf:0' '16' '-maxrate:0' '4653k' '-bufsize:0' '9306k' '-r:0' '23.975999999999999' '-preset:0' 'veryfast' '-x264opts:0' 'subme=0:me_range=4:rc_lookahead=10:me=hex:8x8dct=0:partitions=none' '-force_key_frames:0' 'expr:gte(t,0+n_forced*1)' '-map' '[2]' '-metadata:s:1' 'language=fre' '-codec:1' 'aac' '-b:1' '256k' '-f' 'dash' '-min_seg_duration' '1000000' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/81mkln4pzfcv5wsn8owfm7t9/47fcfd84-4c91-4bac-abea-8ee210510ce4/manifest' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/81mkln4pzfcv5wsn8owfm7t9/47fcfd84-4c91-4bac-abea-8ee210510ce4/progress'

Lastly, the performance numbers I show above are based on a bare host (NON-VM) installation.

If you do not have enough CPUs available, your results will be far worse.
If you’re running Linux in a Windows VM, the issue is compounded.

So in this case, what would be my best solution?

Ubuntu is on a Vmware VM on a ESXI host. The vm currently have all the 32 cores. So youre saying even though I gave it 32 cores, it will never use all of them ?

Thanks for your time, very appreciated :smile:

That’s correct. On a single transcode, it will never use all 32. Transcoding in software is not a massively parallel operation like it is within a hardware GPU.

You’ll have: about 4 for the video, 2 for the audio, and another single thread (known bottleneck point) for subtitle burning. This is per transcode session.

What you need is more “Per thread” speed, not a massively parallel CPU.

As example:

Compare with an i7-7700 which has 8 threads. Look at its per-thread speed.

Good explanation. But still, how come I encounter buffer for 1 stream ? Because of the HEVC ?

Honestly, I didn’t get that part haha

Yes. HEVC is the most difficult codec to process in software.
If this were H.264, that CPU would cut through it like a hot knife through butter
but being HEVC, everything changes. They created the codec to support SDR and HDR (10 bit) color spaces. That takes a lot of CPU to crunch for every frame.

Ok so If I avoid HEVC, my setup should be perfect for multiple transcode (+/- 6 streams)?

When you have multiple transcoding stream, will the transcoder overlap on the other cores ? For example, you mentionned 7 core for a single transcode, will the next stream use the 8th - 14th cores ?

If you don’t use HEVC + subtitles, you’re fine. Subtitles are your nemesis. They are single threaded tasks. You might have 8 actual decode / encode threads running for the video & audio but it all comes screeching to ta halt waiting for subtitles to finish.

Intel is adding subtitle support to the hardware acceleration VAAPI. Eventually, it will also be done.
This particular CPU won’t be able to use it because it doesn’t support QSV (Quick Sync Video)

I’m just blown away that my cpus can’t handle one hevc stream. 2 minutes ago I tried to stream (localy) a episode of Final Space (in hevc) and it kept buffering. But before I changed my server, Plex was running on a Intel® Xeon® Processor E3-1230 v2 and I was able to play it smoothly. What changed since ?

The difference is the 3.3 vs 2.6 Ghz clock speed. This is what drives the ‘per thread processing capability’

More cores is not always the answer. The difference between these two makes this point abundantly clear. 8 at a higher speed than 16 at a slower speed.

In this case, I have 3 streams. All H264, one paused and 8 mile is buffering because the transcoder doesn’t transcode fast enough. Do you see something special ?

Thanks again for your time !

Plex Media Server Logs_2019-09-27_00-03-46.zip (6.3 MB)

It is doing just fine here from what I can see.

Requests are coming in and data being sent out a few milliseconds later.
Look at the “Asked for” and “Returning” right below it.

Sep 27, 2019 00:03:43.010 [0x7f23297fa700] DEBUG - Asked for segment 963 from session.
Sep 27, 2019 00:03:43.016 [0x7f23297fa700] DEBUG - Returning segment 963 from session
Sep 27, 2019 00:03:43.019 [0x7f23297fa700] DEBUG - Content-Length of /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-yx1nc24tuou6rkypv1fdjvkm-8c0631cb-851c-407b-8635-5047b63e4040/init-stream1.m4s,/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-yx1nc24tuou6rkypv1fdjvkm-8c0631cb-851c-407b-8635-5047b63e4040/chunk-stream1-00964.m4s is 96903 (of total: 96903).
Sep 27, 2019 00:03:43.031 [0x7f233affd700] DEBUG - Completed: [173.178.174.119:51399] 206 GET /video/:/transcode/universal/dash/yx1nc24tuou6rkypv1fdjvkm/1/963.m4s (30 live) TLS GZIP 29ms 96903 bytes (pipelined: 63) (range: bytes=0-) 
Sep 27, 2019 00:03:43.034 [0x7f224a7fc700] DEBUG - Request: [173.178.174.119:51401 (WAN)] GET /video/:/transcode/universal/dash/yx1nc24tuou6rkypv1fdjvkm/0/963.m4s (30 live) TLS GZIP Signed-in (range: bytes=0-) 
Sep 27, 2019 00:03:43.041 [0x7f224a7fc700] DEBUG - Asked for segment 963 from session.
Sep 27, 2019 00:03:43.043 [0x7f224a7fc700] DEBUG - Returning segment 963 from session
Sep 27, 2019 00:03:43.043 [0x7f224a7fc700] DEBUG - Content-Length of /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-yx1nc24tuou6rkypv1fdjvkm-8c0631cb-851c-407b-8635-5047b63e4040/init-stream0.m4s,/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-yx1nc24tuou6rkypv1fdjvkm-8c0631cb-851c-407b-8635-5047b63e4040/chunk-stream0-00964.m4s is 477027 (of total: 477027).
Sep 27, 2019 00:03:43.057 [0x7f233b7fe700] DEBUG - Completed: [173.178.174.119:51401] 206 GET /video/:/transcode/universal/dash/yx1nc24tuou6rkypv1fdjvkm/0/963.m4s (30 live) TLS GZIP 23ms 477027 bytes (pipelined: 45) (range: bytes=0-) 
Sep 27, 2019 00:03:43.147 [0x7f22a17fa700] DEBUG - Request: [72.53.98.26:58890 (WAN)] GET /video/:/transcode/universal/dash/yu3x2ejux23lksviok3gopph/0/864.m4s (29 live) TLS GZIP Signed-in
Sep 27, 2019 00:03:43.147 [0x7f225b7fe700] DEBUG - Request: [72.53.98.26:58891 (WAN)] GET /video/:/transcode/universal/dash/yu3x2ejux23lksviok3gopph/1/864.m4s (29 live) TLS GZIP Signed-in
Sep 27, 2019 00:03:43.154 [0x7f22a17fa700] DEBUG - Asked for segment 864 from session.
Sep 27, 2019 00:03:43.155 [0x7f225b7fe700] DEBUG - Asked for segment 864 from session.
Sep 27, 2019 00:03:43.165 [0x7f22a17fa700] DEBUG - Returning segment 864 from session
Sep 27, 2019 00:03:43.166 [0x7f225b7fe700] DEBUG - Returning segment 864 from session

This is really sounding like a networking issue between server and client with this type of performance.