Jump to content

Which is faster Emby plugin or dedicated server?


pclausen

Recommended Posts

pclausen

After standing up my FreeNAS server, I installed the Emby plugin and after messing around with permissions and various other settings for a while, I finally had it up and running.  However, performance didn't seem to be what I remembered from when I was running a Windows server with a lot of local storage.  I was also experiencing freezing and errors on my HTPC clients running ET that would typically require a restart of the Emby plugin to resolve after a couple of days, or worse, a reboot of the entire FreeNAS system (typically weekly at least).

 

The specs of my FreeNAS server are pretty beefy:

  • SuperMicro X10SRL-F
  • Xeon E5-1620 3.5GHz
  • Samsung 2x 16GB DDR4 ECC 2133
  • 2x LSI SAS9200-e8
  • 1x LSI SAS9211-i8
  • 4x 10 2TB RAID-Z2
  • 1x 10 4TB RAID-Z2
  • = 50 disk 120TB pool

So I decided to stand up a dedicated server running Windows 10 64-bit.  So I did a clean install of w10.  Server specs as follows:

  • Asus H87M-E
  • Core i7 4770K
  • G-Skill 2x 8GB DDR3 12800
  • Samsung 840 EVO SSD

After installing Emby on this dedicated server, I pointed it to the ~60TB media library on the FreeNAS server.  It took a while to scan everything, and then another while to cache all the thumbnails etc on the clients (2 Haswell based HTPCs running ET and 2 Roku 3's).  All clients hardwired @ 1 GigE.  But once that was done, everything is running nice and smooth and I would say about 50% faster than when I was using the FreeNAS plugin and the freezes and errors went away.  A full library scan completed in 1 minute 7 seconds (at least the last one did early this morning according to my logs).

 

When I was running Emby as a plug-in, I would often see system loads between 5-7, but now that I'm not running Emby on FreeNAS, the loads are typically under 500 m (0.5) at all times.

 

Memory utilization was around 1.3GB free out of 32GB when running the Emby plugin.  Now without it, I have about 2.5GB free.

 

My only other plugins are SickRage and Transmission.

 

The FreeNAS server is plenty fast as far as accessing the ZFS volume.  Scrubs run at just under 4G/s and scan 60TB of data in under 7 hours.

 

I know the rule of thumb is about 1Gb of memory for each drive, so with 50 drives in the system, perhaps my FreeNAS server was memory starved when running the Emby plugin?  That said, I have never seen any memory swap utilization.

 

Is there a way to tell the Emby plugin how much memory to use, or does it get allocated dynamically as needed?  Right now, with just a single Roku 3 client running, the dedicated Emby server is consuming 2GB out of 8GB of RAM with nothing else running but the Emby server.

 

I would like to go back to using the FreeNAS plugin and re-purpose the hardware currently dedicated to running Emby, but I'm wondering what changes I need to make to realize performance similar to what I have now with a dedicated server, and eliminate whatever was causing the freezing and errors on the ET HTPC clients.

 

I realize that without logs from when I was running Emby as a plugin under FreeNAS, it will be hard to pin-point the exact issue.  I might go ahead and install the FreeNAS plugin on my test FreeNAS server to see if I can replicate the issue and capture logs.

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

Performance seemed fine to me on a recent deployment using a g530 processor I got for $20 in eBay =P

 

But, all clients are openelec (Kodi) HTPCs that are streaming using NFS, so no transcoding.

 

####

 

Not sure how memory is used, but I'm guessing that is allocated at the mono layer. and free RAM is wasted RAM, so I'd say FreeNAS was doing better in that respect.

Link to comment
Share on other sites

  • 2 months later...
pclausen

Hey Josh,

 

Sorry for taking so long to get back to you on this.  So I switched back to using the Emby Plugin a few days ago when the new version was released.

 

I appear to be having some major performance issues that I never experienced when running under windows (with the windows server talking to the FreeNAS server for the media storage.

 

I've been discussing it in this thread over on the windows general section:

 

http://emby.media/community/index.php?/topic/26881-almost-all-titles-transcode-to-both-htpc-and-roku/

 

Before making the switch back to running Emby on FreeNAS, I upgraded the server memory from 32 GB to 64 GB.  So memory is not a concern any longer.

 

On my windows server, I never had issues with 3 or 4 clients running at the same time, with at least a couple of them transcoding some/most of the time.  Now, under FreeNAS, there are issues with just 2 clients running.

 

As a test, I ran 3 clients on my local workstation via 3 Chrome windows, each playing a Blu-Ray title.  That absolutely killed the CPU on the FreeNAS server as seen here:

 

3concurrent.PNG

 

The FreeNAS server has a Xeon E5-1620 v3 quad core CPU which has a PassMark score of 9,623.

 

The i7 4770K CPU in the windows server has a PassMark score of 10,179, which just slightly higher than the Xeon CPU.

 

So why would there be such a performance difference?  Sure, the FreeNAS server CPU has to spent some cycles dealing with the ZFS file system, but that is very minimal.

 

I'd really like to keep Emby running on the FreeNAS server as I try to consolidate things, but I need to be able to support 6 concurrent clients where at least half may be transcoding at any given time.  At the moment my clients are:

 

3 Roku 3 devices

2 HTPCs

1 Workstation (playback via browser)

1 iPad

1 Samsung tablet

 

The Roku's are the heavy users along with one of the HTPCs.  The HTPC won't ever transcode, but it looses connection to the server when the load is heavy from the Roku users.

 

I don't want to replace the Roku clients with HTPC due to expense and maintenance/user issues.  I wonder if there are other alternatives, such as Nvidia Shield that would eliminate transcoding (even to a direct connected TV that only supports 2.0 stereo audio).

 

The other option of course, is to drop an 8 core or higher CPU in the server, but they start at around $700 at go up from there.  Upgrading clients is probably a cheaper option that could bring other benefits with it.  But I don't want to spent any money until I'm sure that I don't have something going on with my current system that can be remedied.

 

Notice in the above screenshot where the Emby Plugin is consuming almost all the FreeNAS CPU resources.  Now look at the screenshot below.  You can see where I stopped playing the 3 transcoded streams, but the Emby plugin keeps burning system cycles to the tune of just over 20% as per the red area.

 

embycpuburn.PNG

 

You can see where CPU drops down the 0%, which is when I shut down the Emby plugin.  The small blue spike is when I turn it back on again, and then it idles like it should.  Not sure what's up with that, but I don't recall having that issue running under Windows.

Edited by pclausen
Link to comment
Share on other sites

pclausen

I made another go at it and was able to get 4 streams going at once.  As expected, the ffmpeg processes are what consumes the CPU.

 

Left putty session is the FreeNAS server itself and the right session is the Emby jail.

 

4concurrent.PNG

 

After closing out all 4 streaming sessions, I just left thing alone and noticed that 2 of the ffmpeg sessions kept going for about 30 minutes before closing out on their own as seen here.

 

4concurrentlater.PNG

 

I looked into how much CPU is needed to transcode a 1080p stream, and it looks like 1080p/10Mbps requires about 2000 PassMark.

 

So I guess I can't expect to do better than I am with that Xeon quad core with a PassMark score just past 9000.  I guess that i7 4770k had just enough extra juice to keep me from having issues before.  I'll keep an eye out for a good deal on a faster CPU, or swap my single socket mobo for a dual socket one.

Link to comment
Share on other sites

josh4trunks

Im not sure why performance is so much worse in your testing. It might have something to do with the mono layer that Linux/freebsd use to execute Emby. but transcoding performance shouldn't be afected since this is handled by an ffmpeg process.

 

I'm probably not the best person to ask as I'm more a package maintainer than developer. @@Luke might have experience with this.

 

I never really have performance issues and I use much slower CPUs (a G860 anf G540) than you in the 2 Emby servers I maintain. But, most of my streaming is done over NFS and at most I'll have single ffmpeg job transcoding at once.

Link to comment
Share on other sites

josh4trunks

hmm, a thought occurred to me. I wonder if your windows PC is using quicksync and/or VAAPI to hardware accelerate the transcoding? since your Xeon setup has no Intel GPU this all pegs the CPU.

Link to comment
Share on other sites

pclausen

Ah, I think you hit the nail on the head Josh!

 

I had a weak moment and stopped by BestBuy on my way home from work and walked out with both a Roku 4 and a Shield.  The Roku still transcodes when outputting 2.0 but the Shield does not.  However, after playing around with the Emby interface, while nice, still didn't quite match what I have in Emby Theater and it does not bitstream lossless content.  Slick unit though.

 

I've been looking around on eBay for Engineering Sample 14 - 18 core E5-26xx Xeons and checking the steppings to see if they are the ones that went into production.  Got my eye on a 14 core at a very good price.  I'm pretty sure that will cure all my transcoding woes.  :)

Link to comment
Share on other sites

josh4trunks

lol, just throw more hardware at the problem. my clients are mostly openelec computers so I only ever need to transcode when I'm watching at a friends house or on my wife's android tab =P

Link to comment
Share on other sites

josh4trunks

gonna build the update for Emby tonight. Mind doing me a favor?

I want to try enabling VAAPI and see if it helps with performance on intel systems with a GPU, but I also need someone to test a system without a GPU to make sure it still works as expected.

 

If you have 20ish minutes to test it out I can try building the PBI. You could just upload the PBI and delete the plugin once you see if transcoding works.

 

Thanks,

Link to comment
Share on other sites

Redshirt

IMO a windows environment is always going to provide better performance for Emby server. Mono is designed to be API compatible with .net but that doesn't mean that the mono implementation will be as efficient as  .net running in it's native environment. 

Link to comment
Share on other sites

pclausen

gonna build the update for Emby tonight. Mind doing me a favor?

I want to try enabling VAAPI and see if it helps with performance on intel systems with a GPU, but I also need someone to test a system without a GPU to make sure it still works as expected.

 

If you have 20ish minutes to test it out I can try building the PBI. You could just upload the PBI and delete the plugin once you see if transcoding works.

 

Thanks,

 

Sure thing Josh.

 

Just let me know the details of how to "upload the PBI".

Link to comment
Share on other sites

pclausen

lol, just throw more hardware at the problem. my clients are mostly openelec computers so I only ever need to transcode when I'm watching at a friends house or on my wife's android tab =P

 

To bad my Samsung TV in the bedroom won't accept a 5.1 input, then all the transcoding there would go away.  If I force the Roku 3 to 5.1 output, transcoding foes away, bur then there is no sound on the Samsung.  I thought about dragging my old Denon receiver out of the closet and connecting it between the Roku and TV since it will allow the Roku to output 5.1 over HDMI, but the layout of my bedroom doesn't led itself very well to having external speakers connected to the receiver.  The wife would not go for that I'm afraid.

 

If someone made a HDMI passthrough device that would pass the video through directly, and accept 5.1 audio and convert it to 2.0, that would be perfect, but seems like a complicated way to get around the issue.

Link to comment
Share on other sites

pclausen

IMO a windows environment is always going to provide better performance for Emby server. Mono is designed to be API compatible with .net but that doesn't mean that the mono implementation will be as efficient as  .net running in it's native environment. 

 

Interesting.  When watching the resources consumed by mono during testing, I have noticed it goes up sharply when navigating the media library from the clients and that might explain why they loose connections to the server sometimes when it is busy transcoding for other clients.

 

One reason I really like running Emby as a FreeNAS plugin is that scheduled tasks are blistering fast since the storage is local vs across a 1 Gbps Ethernet link.  However, both my FreeNAS server and my primary workstation, are now connected to my core switch via 10 Gbps link.  I stole that i7-4770K CPU from the basement HTPC that was used to do double duty as both an Emby client and server, and dropped it into my workstation.  I suppose I could run Emby server on my workstation since it runs all the time anyway.  But then there would be issues if I needed to reboot it or do something else that would consume cpu cycles that would impact the Emby clients.

 

So does each ffmpeg instance take over a physical core?  During my testing, I have never been able to get more than 4 transcoding sessions running at once on a quad core CPU.

 

Another observation, I reduced the max bitrate on the Roku in the bedroom to 3.2 Mbps, but it made no difference whatsoever is the resources being consumed on the server during transcoding.  So I guess the only thing that dictates resource consumption, is the quality of the source media file.  And it also doesn't seem to matter if one only needs to transcode the audio, apparently the transcode processes both audio and video, even when the video output is still the same bitrate as the source.

 

So yeah, at the end of the day, the most logical solution is probably to put a more powerful CPU in the FreeNAS server.  At least I had the foresight to get a SuperMicro mobo with a LGA-2011-3 socket, so my upgrade options are very broad.  The thought of running a CPU with up to 18 cores and 36 threads is pretty cool.  :D
Link to comment
Share on other sites

@@pclausen regarding the roku, have you tried the emby blue neon client on your roku? I am assuming by your post you havent. I added several options for transcoding to the preferences section for just this reason. Is your 5.1 in AC3 or DTS? There is an option to handle DTS as AC3 in there. Firmwares above 6.1 the app can auto detect this on.

 

App: https://my.roku.com/account/add?channel=EmbyBlueNeon

Info: http://emby.media/community/index.php?/topic/24151-theme-blue-neon-night/

 

Sent from my Nexus 7 using Tapatalk

Link to comment
Share on other sites

pclausen

Hey speechles.

 

My source media files can be any of the following:

 

5.1 DD (AC3)

5.1 DTS

5.1 DD+

7.1 DD+

7.1 Dolby TrueHD

7.1 DTS-HD

7.1 DTS-HD Master Audio

7.2.4 Dolby Atmos

 

The vast majority of titles played on the Roku 3 in the bedroom are AC3 titles (TV shows) watched by the wife.  Since the TV there (Samsung UN46D6900WF) won't support anything but Stereo PCM on the HDMI inputs, the Roku auto detects that, and sets it's output to Stereo PCM out.

 

Now, if it was possible to have the Roku "trick" the Emby server into sending it AC3 but only send 2.0 PCM to the TV, that would be perfect!

 

Btw, I did go ahead and download the blue neon theme.  Very sexy!

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

sorry passed out, not enough sleep. I'll build the PBI tomorrow. there's an upload button on the plugins > available tab.

it'll create a sperate instances of Emby in a jail called customjail_1.

 

so the rokus needs transcoding? why can't they just stream files directly?

Link to comment
Share on other sites

pclausen

Since one of my Roku's is connected via HDMI to a TV that only accepts PCM 2.0 audio, Emby has to transcode.  Also, if the audio is FLAC, Emby has to transcode as well, even if the Roku is connected to a AVR that can support the above listed surround formats.  I think the only way to guarantee that transcoding will never happen, is to run HTPC clients exclusively.

 

I guess what I didn't realize going into this, is that if I have 1080p content with a bitrate of say 25 mbps, and the audio is AAC.  Transcoding just the audio to 2.0 and leaving the video alone (since the Roku is set to allow up to 30 Mbps), it apparently takes just as much CPU resource as if I was transcoding the whole thing to 3 mbps or something.

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

Since one of my Roku's is connected via HDMI to a TV that only accepts PCM 2.0 audio, Emby has to transcode.  Also, if the audio is FLAC, Roku has to transcode as well, even if the Roku is connected to a AVR that can support the above listed surround formats.  I think the only way to guarantee that transcoding will never happen, is to run HTPC clients exclusively.

 

I guess what I didn't realize going into this, is that if I have 1080p content with a bitrate of say 25 mbps, and the audio is AAC.  Transcoding just the audio to 2.0 and leaving the video alone (since the Roku is set to allow up to 30 Mbps), it apparently takes just as much CPU resource as if I was transcoding the whole thing to 3 mbps or something.

Roku can't transcode the audio? I know all my openelec boxes can do this just fine.

 

So I guess if you have a reciever or a TV with AAC/DTS this wouldn't be an issue but you're in a weird situation.

Link to comment
Share on other sites

pclausen

That's too bad Josh.  That would have been very cool for the folks not on windows.

 

I went ahead and rolled the dice and ordered that 14 core E5-2683 V3 from Japan as the seller assured me it would work in my motherboard with the BIOS version I have.  If that won't fix the issue, I'm going to get the VCR's out of the attic and set one up below each TV.   :lol:

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

That's too bad Josh. That would have been very cool for the folks not on windows.

 

I went ahead and rolled the dice and ordered that 14 core E5-2683 V3 from Japan as the seller assured me it would work in my motherboard with the BIOS version I have. If that won't fix the issue, I'm going to get the VCR's out of the attic and set one up below each TV. :lol:

this still doesn't explain why your windows encodes faster since VAAPI is never used for ffmpeg encoding and quicksync is (according to that wiki) disabled by default.

 

ohh, and I have a cheaper solution to not use transcoding. build x86 openelec htpcs instead of using rokus. the ones I build cost about $150 each, but can be cheaper if your don't want the exact specifications I want.

Edited by josh4trunks
Link to comment
Share on other sites

pclausen

I might install Emby server on my i7-4770 workstation out of curiosity and perform the test with 4 or more concurrent chrome sessions to see if I max out the that CPU like I did on the FreeNAS server.

 

I thought about mini htpcs instead of the Roku's, but I wonder how close to the dead simple Roku interface I could get that would allow Emby, Netflix and Hulu playback?  Openelec would mean Kodi for Emby, right?

Link to comment
Share on other sites

josh4trunks

I might install Emby server on my i7-4770 workstation out of curiosity and perform the test with 4 or more concurrent chrome sessions to see if I max out the that CPU like I did on the FreeNAS server.

 

I thought about mini htpcs instead of the Roku's, but I wonder how close to the dead simple Roku interface I could get that would allow Emby, Netflix and Hulu playback?  Openelec would mean Kodi for Emby, right?

I thought you already tested that. That would be interesting to see the difference.

 

The interface is pretty simple in my opinion, my wife, and sister's family navigates it just fine including you children and people who have little computer experience. Here's a video of my setup

But... I'm not sure how easy it is to access netflix/hulu, we get all the content we want automatically using sickrage/couchpotato.
 
Yeah, openelec = kodi + linux, then you install the emby addon to get the library synced up.
Edited by josh4trunks
Link to comment
Share on other sites

pclausen

Yes, I did run Emby on the i7-4770K cpu when it was installed in another chassis.  But I never really did any benchmark testing, or even looked at CPU utilization since there never were any problems.

 

Yes, I use sickrage/couchpotato as well, but since I have everything set to 1080p quality for the downloads in sickrage, sometime it takes a couple of days before those encodes come out, and my wife is not the patient type.  Also, there are times when I take Emby down where it is nice to have a backup plan for the users.  There is also a bunch of kids stiff on the Roku PBS channel that I have not attempted to collect with sickrage.

 

But yes, in theory, I agree that we should be an Emby only household.  :)

 

Cool video you did of your setup!

Link to comment
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
×
×
  • Create New...