Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
DezGalbie

How many cores can a Plex server utilise simultaneously for one stream?

Recommended Posts

Posted · Original PosterOP

The question is in the title, basically. I have found myself wondering this, and haven't found a definitive answer. I came across some light discussion of the topic elsewhere online but it got quickly sidetracked and concluded without an answer.

So does anyone here know the answer?

I'm specifically wondering about how many cores can be used together for a single transcoded stream. I know that Plex Media Server can often struggle transcoding and streaming 4K files on the fly, but would this be solved by having a huge number of cores available? Or is there a limit to the number of cores which are utilised together?

For example, you could build a 2012 era dual-socket Xeon server with 16 cores which would presumably do very well at the task if all 16 cores are working on it, but if the software only tends to utilise 4 cores for each instance of this kind of task then you would presumably be a lot better off with a modern mid-range quad core setup due to the better single core performance.

Link to post
Share on other sites
15 minutes ago, DezGalbie said:

I'm specifically wondering about how many cores can be used together for a single transcoded stream. I know that Plex Media Server can often struggle transcoding and streaming 4K files on the fly, but would this be solved by having a huge number of cores available? Or is there a limit to the number of cores which are utilised together?

Are we specifically talking about on-the-fly transcoding, or background-transcoding? Do we have H/W-accelerated decoding on the server, or will that also be done in software?

 

AFAIK, background-transcoding can use pretty much as many cores as you're willing to throw at it, but I dunno about on-the-fly. What muddies things a little is that there's also the audio-encoder and video-decoding; from what I've seen is that the audio-encoder appears to be single-threaded and I think the video-decoder is as well, though I'm not entirely 100% on the latter. Oh, and there's a new Plex-version in beta, that has seen a lot and lot of work on all the encoding- and decoding-stuff, and I think even better multi-threading was mentioned as one of the features.

24 minutes ago, DezGalbie said:

For example, you could build a 2012 era dual-socket Xeon server with 16 cores which would presumably do very well at the task if all 16 cores are working on it, but if the software only tends to utilise 4 cores for each instance of this kind of task then you would presumably be a lot better off with a modern mid-range quad core setup due to the better single core performance.

Wouldn't just buying a used GTX1050 be cheaper? At least that's the route I've taken: GTX1050 can do two encodes in hardware simultaneously, leaving the CPU-cores for more important stuff and it cost me 80€.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
2 minutes ago, WereCatf said:

Are we specifically talking about on-the-fly transcoding, or background-transcoding? Do we have H/W-accelerated decoding on the server, or will that also be done in software?

1

Talking about on-the-fly. When asking the question I didn't have hardware accelerated transcoding in mind, I was just trying to get my head around the difference in CPU performance between certain setups.

Does a 1050 help a lot?

Link to post
Share on other sites
29 minutes ago, DezGalbie said:

Does a 1050 help a lot?

On my 4-core Xeon under Linux, I am seeing about 240% CPU-utilization, ie. two cores at full load and one at 40%, with 1050 doing H/W-encoding and with H/W-encoding disabled, I am seeing up to 380% CPU-utilization and framedrops. This is with a 4K HDR HEVC / 7.1 DTS-HD MA - source to 1080p / 5.1 AAC, and some of the CPU-utilization goes into the encoding of audio and decoding of video, since I don't have H/W-decoding. This is to say, yes, there is quite a noticeable benefit to H/W-encoding.

 

Also, apparently, the upcoming Plex-version should enable H/W-accelerated decoding as well on NVIDIA-cards (it's not supported at the moment), so the 240% CPU-utilization I was seeing would drop even further. If you insist, I can test the beta-version sometime today to see what kind of difference it makes.

 

EDIT: I actually got curious and tested the beta. NVDEC-support has been enabled in the build, but it's not actually used by Plex yet, though it's possible to make Plex use it by editing one of the scripts. I did just that, tested the above video and CPU-utilization dropped to 101% -- that's just massive gains in performance!


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
20 minutes ago, WereCatf said:

apparently, the upcoming Plex-version should enable H/W-accelerated decoding as well on NVIDIA-cards (it's not supported at the moment), so the 240% CPU-utilization I was seeing would drop even further. If you insist, I can test the beta-version sometime today to see what kind of difference it makes.

If you'll be checking it out anyway then I would be interested in seeing the figures, yeah. But don't go out of your way just for me. I have graphics cards at home I could test with to see the difference without having to buy extra hardware, but I don't have the kind of Xeon setup I mentioned in the question. So I was more interested in the dynamics of CPU performance etc. And this question about the utilisation of cores per stream kinda stuck with me.

 

Thanks :)

Link to post
Share on other sites

well plex just uses ffmpeg and its encoders for streaming, so its the same as normal ffmpeg encodes.

 

There is no real hard limit, but scaling gets worse past around 8-16 threads with x264. High resolutions have better multicore scaling.

 

FFmpeg for x264 also uses things like avx2, so having a cpu with that can help a good amount.

Link to post
Share on other sites

I've seen all 24 cores going nuts on my Plex server when transcoding high bitrate hevc 4k streams but thats with multiple streams. 

Plex uses the ffmpeg libraries, but with their own python based transcoder that uses python multi-threading. It spawns a process for every core, so when im hitting my Plex server hard you'll see 24 python processes, one for each cpu thread. Not sure how many max could be used by a single stream though because I don't know the logic behind PMS transcoder

 


Spoiler

Intel i7 3770K @ 4.6ghz | EVGA Z77 FTW | 2 x EVGA GTX1070 FTW | 32GB (4x8GB) Corsair Vengeance DDR3-1600 | Corsair H105 AIO, NZXT Sentry 3, Corsair SP120's | 2 x 256GB Samsung 850EVO, 4TB WD Black | Phanteks Enthoo Pro | OCZ ZX 1250w | Samsung 28" 4K Display | Ducky Shine 3 Keyboard, Logitech G502, MicroLab Solo 7C Speakers, Razer Goliathus Extended, X360 Controller | Windows 10 Pro | SteelSeries Siberia 350 Headphones

 

Spoiler

Corsair 400R, IcyDock MB998SP & MB455SPF, Seasonic X-Series 650w PSU, 2 x Xeon E5540's, 24GB DDR3-ECC, Asus Z8NA-D6C Motherboard, AOC-SAS2LP-MV8, LSI MegaRAID 9271-8i, RES2SV240 SAS Expander, Samsung 840Evo 120GB, 2 x 8TB Seagate Archives, 12 x 3TB WD Red

 

Link to post
Share on other sites

It'll use whatever you happen to have. I'm using a dual xeon 5640. It's overkill but they were like $15 for the pair shipped and I thought it would be 'neat.' Never did hook it up to a kill-a-watt, I'm too afraid to look. I mean, it transcodes like a champ but my SHIELD direct plays everything anyways so what's even the point. Loaded a 4k demo vid in a few tabs for demonstration purposes.

Also, one challenge I didn't plan on was cooling the northbridge due to the CPU interconnect. The supermicro board has no onboard cooling options as it's meant to live inside a server room. Currently have a stick-on passive sink with a noctua fan aimed directly at it, mostly does the job. Without it, the CPU coolers run at max speed even though the processors themselves are perfectly cool.

 

BodXOuf.png


Intel 3570K @ 4.4GHz - Gigabyte 1070 - Samsung 860 EVO - 16GB DDR3

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×