Jump to content

High CPU Usage in the 3.2.32.0


csadoian

Recommended Posts

csadoian

Today when Emby went to record my regular schedule of ABC World News Tonight followed by my Local News, I happened to notice my Emby server was running at 99% CPU usage.  Memory usage was ok, just a lot of CPU usage.

 

The result of this high CPU usage played havoc with the two recordings.  The recording of ABC World News Tonight didn't appear to start recording until about 4 minutes into the program.  Normally the length of the recording is around 32 minutes, this time it was only 27:30.  It appears the server was so busy it could not start actually recording the program at the scheduled time.

 

I checked at around 18:10 and the recording of ABC WNT apparently was still going, if you believe EMBY's dashboard.  The local news appeared to NOT be recording, but they are on the same channel.  So I let everything play out and checked it again around 19:00.  The ABC WNT recording had showed up, and in the actual folder it was timestamped 18:19.

 

A folder for Action News LIve at 6pm (my local news) had appeared, created at 18:39 (remember the program records from 18:00-18:30).  The recording of the program was inside the folder, also timestamped 18:39.  However, it was much shorter than normal.  It appears to be only 11 minutes long, which would mean Emby started saving this file after it finalized the ABC program at 18:19.

 

I believe this behavior was caused by the fact that the Emby server was using almost 99% CPU, even when I checked it at 19:00, when it was not recording anything.

 

I was forced to restart the server to get everything back to normal.

 

Maybe the log will tell you why Emby was using so much CPU.

 

I do know that I was having a bit of antenna trouble earlier in the day.  I have an amplified outdoor antenna and the power injector went out on me.  When this happened Emby was in the process of recording a program on the Connect tuner, and when the antenna amp started going out the Connect tuner would start blinking the tuner light, then it would go steady if the signal returned.  It did this several times, so I finally just stopped the recording and deleted it.  I don't know if this had anything to do with it.  I did NOT reboot the server after this happened, nor did I notice if Emby was using high CPU at that time.

 

The screenshot shows the Emby Server using 63% CPU because it had to give some up for FFMPEG and some minor processes.  The total machine usage was consistently 99%.

 

 

 

 

post-227234-0-10506100-1506133842_thumb.jpg

server-63641648700.txt

  • Like 1
Link to comment
Share on other sites

csadoian

Another thing I would like to add ... it seems the last few versions of Emby Server (I don't know exactly when it started, but it may have been just after the guide problems that popped up a couple of weeks ago) CPU usage is higher even when doing direct play.

 

I may be mistaken, but I seem to remember prior to these later version of the server, when I played a live TV channel using Emby Theater for Windows (to ensure Emby would not transcode) the increased load on the server was negligible, maybe a few percentage points.

 

With the latest versions of Emby Server, I now see CPU usage as high as 35% for a direct play stream.  Seems awfully high to me.

 

In addition, after I stopped the stream and no other streaming or recording is going on, Emby is STILL using upwards of 30% CPU usage.

 

In the attached server log, look near the very end, that's where I was playing a direct stream and then stopped (around 13:11 I think).

 

 

post-227234-0-28539000-1506198196_thumb.jpg

server-63641735100.txt

Link to comment
Share on other sites

csadoian

As a follow up to this thread, I decided to roll my server back to 3.2.29 for a test.  I also disabled all hardware acceleration in transcoding.

 

Using 3.2.32, I tuned to a live HD TV channel on my HDHomeRun Prime box.  Emby wanted to transcode it for some reason (I forgot to look for the reason), and while it was playing my CPU was running around 60% for this single channel.  Roughly 38% for FFMPEG, around 22% for the Emby server itself.

 

Using 3.2.29, I tuned to the same channel and Emby chose NOT to transcode it (same client, my Android TV box), and my CPU was like 2%.

 

Shortly after that a recording started on another HD channel on my Prime tuner, so I shut down my other stream and then looked at the CPU usage just for the recording.  Total CPU is around 30%, with FFMPEG running around 28% and Emby running around 2%.  Still WAY lower than what I was seeing on 3.2.32 for a single channel.

 

So there is a SIGNIFICANT difference between 3.2.32 and 3.2.29 in CPU usage, especially in the Emby server itself, something I never saw before these latest releases.

 

Attached are server logs.  The smaller log is after I changed to 3.2.29, the larger log is 3.2.32.  The relevant time period in the larger log is 9/24/17 after 9am, which is when I was watching a single live TV channel as described above.

 

Edit:  Attached ffmpeg logs.  I am not absolutely sure about these logs, they don't seem to provide any timestamps in the log itself.

 

The transcode log is when I was watching the channel described above while on 3.2.32.  The remux log is when I switched over to 3.2.29.

 

I am not sure why there was no transcoding of the channel when I switched over to 3.2.29.  I was using the same client (Android TV box) and most of the time no matter what I do it always forces a transcode, mostly for unsupported audio codec.

 

server-63641808000.txt

server-63641847316.txt

ffmpeg-transcode-7202b7c6-34bf-489a-a9d7-8561c328b652.txt

ffmpeg-remux-84ed94cc-a34a-4706-86cc-4c5f945522c5.txt

Edited by csadoian
Link to comment
Share on other sites

csadoian

Here is another test with logs that demonstrates the high CPU usage.

 

I opened up a channel on my Prime tuner using my Android client.  It was transcoded because it complained about the audio codec not being supported.

 

While playing this channel my server was running around 70% CPU, split 45% FFMPEG and 25% Emby Server.

 

I then shut down that stream and let FFMPEG exit and Emby settle down.

 

I then opened up Emby Theater on Windows and tuned to the same channel.  This stream was a direct play stream, which means FFMPEG was not involved, but Emby Server was running at 30% CPU usage.

 

You can see that with Emby using so much CPU it's kind of tough to record and/or watch more than two channels at the same time.  If there is any transcoding involved, things really get bad.  I think that is why I experienced what I described at the beginning of this thread.

 

This did not happen on 3.2.29.

 

I am NOT running any hardware acceleration at this point for transcoding.  I AM running an SSD for my Transcoding temporary path.

 

 

server-63641868350.txt

ffmpeg-transcode-bd03a31c-5c5d-463a-ac07-c0bcc0595113.txt

Link to comment
Share on other sites

csadoian

Isn't 15MB a rather high bitrate to transcode?

 

Yeah, that was an accident  ... I was messing around with the settings on the Android TV app and forgot I left it at 15mbps.  Its back to auto now.

 

But that isn't the root of the problem.  As I type this Emby is recording two programs, NFL Sunday Night Football and ABC World News tonight, both OTA on my CONNECT tuner.

 

My Emby server is running at an average of 97% CPU at the moment.  The Emby server is averaging around 30% CPU, one FFMPEG task is averaging around 47% and the balance of 20% or so being used by the other FFMPEG stream.  No viewing is taking place, only recording.  One stream is 1080i, the other is 720p.  I assume the FFMPEG task with the most CPU is working on the 1080i stream.  Emby is recording these on a Western Digital 4TB MyCloud Network drive via a gigabit network.

 

Two live streams seems to be all my Emby server can handle now, that's not how it was before the last couple of releases.

 

Didn't have these types of problems when I was using NextPVR ... but it records in .ts format, no transcoding while recording.

Link to comment
Share on other sites

I think the difference is we are now properly de-interlacing them.

 

Did you enable the new de-interlacing option in the server that would cause slower de-interlacing performance as well?

Link to comment
Share on other sites

csadoian

I think the difference is we are now properly de-interlacing them.

 

Did you enable the new de-interlacing option in the server that would cause slower de-interlacing performance as well?

 

I assume the option you are talking about is under Transcoding.  Mine has only two options, "Standard" and "Bob and Weave".  It is set to "Standard".  I don't see a way to turn it off.

 

This wouldn't explain why the server continues to consume 25-30% CPU AFTER the program has ended and there are no live streams being processed.  The only way I get get Emby back to 1-2% CPU use (idle) is to restart the server.

 

Last night, during the recording of NFL Sunday Night Football, my Emby server ran the entire time at 99% CPU.  It was the only thing being recorded ... I was afraid to open a client to watch it at the same time.  I watched most of it on a TV connected directly to an antenna.  After the recording ended, Emby fell back to 30% CPU and stayed there.  I let it stay there for 30 minutes, then I restarted the server to get it back to 1%.

 

At this point I am thinking of returning to NextPVR for my main DVR, as the new TV season is starting and the wife is not going to like it if the programs are not recorded correctly.  There will be several instances where at least two programs will be recorded at one time, and occasionally three.  At this point my Emby setup cannot handle that.

 

I will keep Emby server online for testing and continue to give you whatever feedback I can.  I really like Emby and want it to work for me, but I can't afford a supercomputer to run it on :) 

Link to comment
Share on other sites

maegibbons

Yeah, that was an accident  ... I was messing around with the settings on the Android TV app and forgot I left it at 15mbps.  Its back to auto now.

 

But that isn't the root of the problem.  As I type this Emby is recording two programs, NFL Sunday Night Football and ABC World News tonight, both OTA on my CONNECT tuner.

 

My Emby server is running at an average of 97% CPU at the moment.  The Emby server is averaging around 30% CPU, one FFMPEG task is averaging around 47% and the balance of 20% or so being used by the other FFMPEG stream.  No viewing is taking place, only recording.  One stream is 1080i, the other is 720p.  I assume the FFMPEG task with the most CPU is working on the 1080i stream.  Emby is recording these on a Western Digital 4TB MyCloud Network drive via a gigabit network.

 

Two live streams seems to be all my Emby server can handle now, that's not how it was before the last couple of releases.

 

Didn't have these types of problems when I was using NextPVR ... but it records in .ts format, no transcoding while recording.

 

So ffmpeg is running when you are JUST recording.  This means you have record-transcoding switched on in Live TV settings.

 

Switch this off by unticking "Automatically convert recordings to a streaming friendly format".  Recording on its own should then take up very little resource. About 20% cpu for 3 Channels at once.

 

FFmpeg will be used in playback to a greater or lesser extent dependent on client capabilities and video format.

 

Krs

 

Mark

Link to comment
Share on other sites

csadoian

Yes, unticking the "streaming friendly format"  would reduce the load on the system during recordings, NextPVR records in native .ts format and I used it for over a year before migrating over to Emby, so I was used to the larger file sizes it generates.  That is one alternative I am considering at the moment.  I really like Emby and would like to stay with it but I have to figure out a way for my server to be able to handle a couple of simultaneous recordings along with a client or two watching live TV without bogging down so much that it slows to a crawl.

 

Two questions that hasn't been answered yet is (1) What is causing the Emby server to suddenly use 30% CPU when recording (De-interlacing?) and (2) why my Emby server does not return to an idle condition of around 1-2% CPU usage after a recording stops.  It just stays at 25-30% unless I restart the server.

 

If De-interlacing is causing the extra CPU load, can the user turn it off?

Link to comment
Share on other sites

maegibbons

No

 

Emby does not do anything on record.  Most stuff is spawned to ffmpeg. Emby process handles stuff like Refreshing TV guide and scannin media.  the only way to analyze exactly what it is doing is to switch on debug logging and analyze what it is doing whilst recording.

 

Do this with the the "Automatically convert recordings to a streaming friendly format"  unticked so that there is no ffmpeg processes going.

 

Krs

 

mark

Link to comment
Share on other sites

csadoian

No

 

Emby does not do anything on record.  Most stuff is spawned to ffmpeg. Emby process handles stuff like Refreshing TV guide and scannin media.  the only way to analyze exactly what it is doing is to switch on debug logging and analyze what it is doing whilst recording.

 

Do this with the the "Automatically convert recordings to a streaming friendly format"  unticked so that there is no ffmpeg processes going.

 

Krs

 

mark

 

Well, while recording 3 programs at the same time my Emby server was using over 70% CPU, so SOMETHING is going on.  I can't believe it takes so much CPU time to write 3 streams to my NAS storage unit WITHOUT any transcoding (.i.e."Automatically convert recordings to a streaming friendly format" is unchecked).

 

Is this overhead being caused by de-interlacing?  Emby did not show this CPU usage until just recently.

post-227234-0-40937600-1506366197_thumb.jpg

post-227234-0-47797600-1506366207_thumb.jpg

Link to comment
Share on other sites

Happy2Play

To me it would appear to be specific to your setup as no one else is seeing this issue.  But no setup is the same so it is just a guess.  I have not seen any of my production or test system experience really any cpu useage from the "MediaBrowser.ServerApplication.exe".

 

Does cpu usage return to 0 when idle?

Edited by Happy2Play
Link to comment
Share on other sites

maegibbons

As replied "No"  Emby does not de-interlace - that would be passed off to ffmpeg if required.

 

Yes 70% is too high.  What is the cpu?

 

What is the cpu clock running at?  I had a very recent problem with my cpu being thermally throttled.  Download CPU-z to show clock speed.

 

Krs

 

Mark

Link to comment
Share on other sites

csadoian

As replied "No"  Emby does not de-interlace - that would be passed off to ffmpeg if required.

 

Yes 70% is too high.  What is the cpu?

 

What is the cpu clock running at?  I had a very recent problem with my cpu being thermally throttled.  Download CPU-z to show clock speed.

 

Krs

 

Mark

 

The server is an HP Elite 8300, Core i5-3470 3.2Ghz, 8GB memory, 1TB HDD, 250G SSD (for transcoding), Nvidia GeForce GT 710 video card, Windows 7 Professional 64 bit

 

If no one else is seeing the CPU issue, then maybe I better take the time to do a clean install.

Link to comment
Share on other sites

csadoian

To me it would appear to be specific to your setup as no one else is seeing this issue.  But no setup is the same so it is just a guess.  I have not seen any of my production or test system experience really any cpu useage from the "MediaBrowser.ServerApplication.exe".

 

Does cpu usage return to 0 when idle?

 

When I eliminated the transcoding of recordings the CPU returned to normal almost immediately after the recordings ended.

 

When transcoding recordings CPU does not return to normal, but it may be that I didn't wait long enough.  I had a recording today that went from 10-11am.  At 11:10am Emby said it was STILL recording it, but the tuner light was off.  I waited a bit more and at 11:17am Emby returned to normal, and the resulting .mkv file was timestamped 11:17am.  I wonder what Emby was doing for that 17 minutes after the recording ended?

 

Note:  FFMPEG was STILL running during that 17 minute period.

Edited by csadoian
Link to comment
Share on other sites

csadoian

Well, just finished a clean install of 3.2.32 and nothing changed.  Still acts exactly the same as described above.

 

I think I will do another clean install and just use 3.2.29 for the time being.  It did not have the CPU issue on my system.  I will keep an eye on the new releases and check them out on a test server.

Link to comment
Share on other sites

csadoian

Competed fresh install of 3.2.29, working much better now.  Presently recording a program OTA and CPU usage is around 25%, mostly by FFMPEG.  Emby Server is around 1-2%.  3.2.32 was using around 60% for one recording (with transcoding), including upwards of 30% just for the Emby Server.  A BIG difference.

 

Can't understand why I'm the only one that is seeing this problem.  Must be a reason.

  • Like 1
Link to comment
Share on other sites

I am also seeing greatly increased CPU utilization since 3.2.32.0.  I have two HD Primes and when taping four streams the CPU is now over 90% whereas it would be under 10% on 3.2.30.  Even a single stream holds steady around 30%.  Deinterlacing defaulted to Standard and I do not do any automatic streaming-friendly converting,  I have an i7-7700K so that I can transcode on the fly as needed.  I haven't noticed any recording quality degradation/loss and my start/stop times have been OK, but when your CPU usage goes from practically nil to almost maxed out, something changed.  (This is all recording...no playback.)

 

I have attached screen shots of single steam recording, three streams and the latest server logs.

post-171656-0-82400200-1506387360_thumb.jpg

post-171656-0-46371500-1506387365_thumb.jpg

server-63641899257.txt

Edited by AlKaHall
Link to comment
Share on other sites

maegibbons

Well I am possiblty not because I am using the new .Net Core builds and they use a lot less cpu anyways.

 

You may want to give them a run.

 

Krs

 

Mark

Link to comment
Share on other sites

jasonmcroy

I wanted to chime in here because I got home tonight after upgrading earlier to 3.2.32.0. When I left everything was fine. When I got home I could hear my HTPC humming which isn't normal when something isn't being transcoded from Emby. It was mid a recording which I have set to "Convert to friendly streaming format" and I also check to preserve original video and audio because that only uses about .3% cpu per recording.

 

However, the Server itself was using a lot of CPU by itself (which isn't normal when it's recording anything - it is usually at 0). The recording that was happening finished but the server is still running a higher than usual CPU usage.

 

Here are some screenshots:

 

During recording:

 

post-106-0-65573400-1506396104_thumb.jpg

 

After recording stopped:

 

post-106-0-99824800-1506396162_thumb.jpg

 

Here are some logs:

 

server-63641955248.txt

record-transcode-9107b298-d8b8-42ff-a2ba-251cdaebfcb6.txt

record-transcode-c3f6b835-3205-4bcb-87ec-345459e5f361.txt

 

After I restarted the server the cpu usage went back to normal:

 

Here is a screenshot of how it normally looks:

 

post-106-0-61282200-1506396220_thumb.jpg

 

 

Link to comment
Share on other sites

jasonmcroy

I wanted to add a little bit more information to see if it helps narrow anything down. I added two movies to my movies folder just a few minutes ago and I notice that the server starts using CPU again while downloading the metadata, which is normal, but what isn't normal is that I notice that once it is finished downloading the metadata it the CPU load doesn't drop back down. Maybe the server isn't quitting whatever it does to download the metadata?

 

That makes sense because before I left the house earlier I had also added a movie to the movie folder. 

Link to comment
Share on other sites

travisolson99

I am having the same issue.  I have 2 machines with Emby installed and they both ramp up the CPU when recording a show with my HD Home Run.  The server is not set to transcode on the fly.  It will consume about 100% or the CPU when 4 shows are recording, which renders the server dead when trying to watch another show.  This has not happened in the past.  This is new to the new updated server.  This is not an issue with my plex server while recording the same 4 shows.

Link to comment
Share on other sites

csadoian

I appreciate the reports that others are experiencing the same issue ... at least I know it's not just me or something unique to my installation.

 

For the time being, until the problem can be identified and addressed, I am using 3.2.29, which is working just fine.

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...