Jump to content

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

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 comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

I know it really struggles with subtitles on 4k content. Something about that aspect of the process being single-threaded. 

Link to comment
Share on other sites

Link to post
Share on other sites

The most I have ever seen a steam use is 8 cores for processing, haven't ever seen a transcode process use more than that.

Please quote or tag me if you need a reply

Link to comment
Share on other sites

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

Desktop: Ryzen9 5950X | ASUS ROG Crosshair VIII Hero (Wifi) | EVGA RTX 3080Ti FTW3 | 32GB (2x16GB) Corsair Dominator Platinum RGB Pro 3600Mhz | EKWB EK-AIO 360D-RGB | EKWB EK-Vardar RGB Fans | 1TB Samsung 980 Pro, 4TB Samsung 980 Pro | Corsair 5000D Airflow | Corsair HX850 Platinum PSU | Asus ROG 42" OLED PG42UQ + LG 32" 32GK850G Monitor | Roccat Vulcan TKL Pro Keyboard | Logitech G Pro X Superlight  | MicroLab Solo 7C Speakers | Audio-Technica ATH-M50xBT2 LE Headphones | TC-Helicon GoXLR | Audio-Technica AT2035 | LTT Desk Mat | XBOX-X Controller | Windows 11 Pro

 

Spoiler

Server: Fractal Design Define R6 | Ryzen 3950x | ASRock X570 Taichi | EVGA GTX1070 FTW | 64GB (4x16GB) Corsair Vengeance LPX 3000Mhz | Corsair RM850v2 PSU | Fractal S36 Triple AIO | 12 x 8TB HGST Ultrastar He10 (WD Whitelabel) | 500GB Aorus Gen4 NVMe | 2 x 2TB Samsung 970 Evo Plus NVMe | LSI 9211-8i HBA

 

Link to comment
Share on other sites

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 11700K - Gigabyte 3080 Ti- Gigabyte Z590 Aorus Pro - Sabrent Rocket NVME - Corsair 16GB DDR4

Link to comment
Share on other sites

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

×