Plex Transcode (Multi-threading / dual CPU / many many cores / hyper-threading) question!

Hi all,

About a year ago I decided that I wanted to build the best machine to host Plex that I could on a budget. I found an older Dell Precision T5600 dual CPU workstation and upgraded the processors (2x - Xeon E5-2670 - 16 cores / 32 threads) and it’s an absolute beast. (I completely recommend this route, I think I paid maybe 600 USD all in - much cheaper than Broadwell-E i7 systems.) However, I noticed some interesting things while using the sync feature - which does all of the transcoding upfront.

I’m trying to understand how multi-threaded the Plex transcoder is…

Observations:

  • With hyper-threading enabled Plex ignores / doesn’t use 16 of the available threads (aligns with the physical CPU)
  • With hyper-threading disabled Plex uses all threads and is about 25% faster (20 minutes vs 16 minutes for the same blu-ray rip.)

Is this a quirk of the dual CPU setup? Or will Plex only use 16 threads? (I realize that some of this will vary based on the type of media.)

We’re leveraging the sync a lot lately, so I was contemplating upgrading … but I’d like to understand how the Plex transcoder (Based on ffmpeg, if I remember) uses threads / cores.

Thanks!
Justin

1 Like

I would like to know this as well…

1 Like

Unless the video stream is VC-1 Plex will use the available cores.
VC-1 is a single thread process (very unfortunately).

The moral of the story is if you have a lot of VC-1 streams you would be well advised to:

  1. ‘recode’ - or if building
  2. purchase the best ‘Single Thread Rated’ processor you can find.

Personally, I go with option #1:
https://forums.plex.tv/discussion/comment/1335697/#Comment_1335697
It can be a painfully long process (that whole single core thing) - but not nearly as painful as that ‘buffering wheel’ while you’re trying to watch something.

I did some more digging after making this post and there are a few things that I learned.

In addition to some types of media not doing well with a dual CPU setup (in addition to the above VC-1 comment), which is what I had, there are other rules built into some of the encoding process. I’m paraphrasing, but I’m sure you could find this in some of the video forums. Basically, you can only use so many threads without degrading quality. There’s a rule about the number of lines of horizontal (or was it vertical) resolution divided by some number being the number of threads that you should use. Too many cooks spoil the broth I guess?

For what it’s worth, I upgraded the machine that runs plex anyway since the workstation was always too big and a little too loud. I grabbed a mini itx case (Ncase M1), a super tiny ASRock motherboard, and an 18 core (36 thread) Xeon v4 engineering sample … It’s a little faster, but not a lot when I do a single transcode using the sync functionality. That said, it fails to max out the CPU - 1 1080p H264 transcode (using sync) only puts the CPU at between 25-35%.

Unless you have a lot of people hitting your Plex at the same time (I do, so in theory my many cores help with this), I feel like the AMD Ryzen 8 core configurations are probably now the best bang for your buck. I haven’t used them, so I can confirm that they’re optimized well… but they seem to do well at encoding. (And supposedly H2 2017 they’ll be releasing the server chips with more than 8 cores…)

I use the sync functionality a lot while traveling and sometimes only get to spend a bit of time at home. So fast transcodes (while controlling file size) are important to me. I’m excited that there’s a new Plex Pass (Preview) feature that leverages the GPU.

@justinoes said:
I found an older Dell Precision T5600 dual CPU workstation and upgraded the processors (2x - Xeon E5-2670 - 16 cores / 32 threads) .
Observations:

  • With hyper-threading enabled Plex ignores / doesn’t use 16 of the available threads (aligns with the physical CPU)
  • With hyper-threading disabled Plex uses all threads and is about 25% faster (20 minutes vs 16 minutes for the same blu-ray rip.)

I have a practically identical T5600 setup to yours and can validate all your observations including that of hyper-threading.

I noticed this thread gets a fair number of views still so I wanted to give an update with a (somewhat tenuous) conclusion.

I switched from the 18 core xeon v4 engineering sample (it died and took the board out with it - PSA : don’t buy engineering samples) to a 14 core xeon v3 and didn’t notice much a difference. My observations across a range of situations (dual 8 core cpus, single cpu 18 cores, single cpu 14 cores) is that Plex can definitely take advantage of more threads than most consumer grade CPUs have (2/4), but giving up clock speed to get a ton of cores may have some diminishing returns because the CPU rarely maxes out. I suspect that different codecs behave differently, which is part of the reason for the variation.

To that end, I’m going to see if I can further “right size” the machine that runs Plex down to a newly announced AMD 2700X … and maybe make some cash selling my old Xeon CPU and motherboard.

If anyone is interested, I’m happy to do some pre post testing and post the results of dropping six cores, but gaining quite a bit of frequency.

Justin

1 Like

I also have about the same T5600 setup. Didn’t see this post before upgrading from dual e5-2643 to dual e5-2690. The new CPUs are twice as powerful, yes, but the fact that Plex can only use half of it at a time is annoying the crap out of me. What’s the point in upgrading if it can’t use all of it? I upgraded so that 4k->1080p transcoding would work faster than realtime and it just won’t. I literally gained no benefit other than having the increased capacity for multiple streams. I don’t particularly want to give up my ridiculously powerful machine (more powerful than an 8700K) but at the same time it looks like I’m almost forced into an 8700K due to the higher SC speed and lower core count.

It bears repeating that an intelligent choice of storing media (probably x264/AAC/MP4) generally avoids the need for on-the-fly transcoding. I don’t bother keeping HEVC/4K media because I don’t have any players for it. Whenever that changes then maybe I add a GPU or maybe I just keep 1K and 4K in separate libraries. Disk space is cheap.

@blockofdynamite - I saw better Plex transcode performance with two CPUs when I disabled hyperthreading. I suspect there’s a penalty for using two physical CPUs, but also diminishing returns on the number of threads Plex will use. This might not be an option if your machine is serving multiple roles - Handbrake, for example, does seem to scale better across CPUs and see improvements with HT. I’m actually switching to the Ryzen 2700x from a Xeon E5 2683 v3 (hopefully this week - motherboard on pre-order). Two extra cores + cheaper = win over the 8700k since my Plex machine doesn’t do any gaming. But the 8700k comes with an iGPU that does hardware transcoding. Basically, there are no easy answers.

@dduke2104 - Completely agree about separating 4k and lower into different libraries - only the latter is shared with family. I’ve - so far - avoided transcoding my library for fears of lowered quality and just the amount of time it would take to transcode even a portion of my library.

@justinoes said:
I’ve - so far - avoided transcoding my library for fears of lowered quality and just the amount of time it would take …

Easy enough to set up manageable batches for Handbrake to process in background. I’ve put virtually every one of my 2000+ movies though it.

@dduke2104 I mean most of the time I’m not doing any transcoding at all since I mostly use it at home. The transcoding comes when people stream from outside my network (I limit that to 4mbps 720p because of both upload bandwidth and total data cap) and when I transcode 4k to 1080p. What I’ve been having to do is “optimize” the 4k media into a 1080p file so that either the transcoding is more manageable or it has to do none at all. My only reason for upgrading was so that I could do 4k -> 1080p or 720p transcoding on the fly, but I guess I’ll have to give up on that. Not too upset about it but it makes me all that more tempted to grab an 8700k if I find an irresistible deal.

Luckily I was able to sell off 6 of my 8 16gb sticks, so I lost no money in the CPU upgrades. Just not excited about DDR4 prices if/when the time comes.

1 Like

He who transcodes least, transcodes best.

2 Likes

I ran my Plex setup on a Dell T7500. X5670 for years. It was $300 off ebay. I had 96gig of memory (free off old servers from work lol). I slammed 2 icy doc cage converters into that gigantic box to get about 11 drives total. Using a cheap ass highpoint raid controllers and WD clam shell 8tb drives. It was a honking 48TB (RAID6) beast. As for the issues with CPU/Threads and transcode, I tossed a GTX 970 into the system and all my transcode ended up using that. Plex is smart enough to detect the GPU. If the GPU got busy it defaulted to CPU cycles. I have about 40 friends on the box with an average of 3 users per night. Holidays I get about 11 people coming in.

I have recently upgraded the T7500, concentrating more on power conservation. I run a E5-2650L v4 14core (65w) now and a 1050Ti (75w max). Its all RGB’ed/Hard pipe water cool with reservoir up now since it seems to be the constant box in house that keeps on ticking so i fancied it up.

For the guys using handbrake to manipulate their video collection, i use to use HB and it was dog slow because as you guys are saying more cpu threads more speed. i needed something to use the GPU. I went with staxrip. It can re-sample blu-ray x.264 at 5x to 7x speed. A dual pass run of a 3.8gig tv episode only need about 12minutes. i shave about 1.4 gigs off using a 6000 sampling rate. A x.265 re-encoding is at 1.2 speed. Still slow but way faster than a single cpu.

As for libraries, yes for now… store 2 version if needed in x.264 and x.265 10bit in separate libraries. i only use the 10bit at home.