Jump to content

High CPU usage 4.2.0.40


jeffu231

Recommended Posts

Could you please::

  • activate debug logging (on the logging page)
  • Restart Emby
  • Reproduce the high CPU load once for a few minutes
  • Post the logs (server + ffmpeg)

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

The upcoming beta 4.3.0.9 will have a hidden config switch in the server xml config file - UseLegacyLiveStream - set that to true and start the server. Then see how it compares. thanks.

Link to comment
Share on other sites

The upcoming beta 4.3.0.9 will have a hidden config switch in the server xml config file - UseLegacyLiveStream - set that to true and start the server. Then see how it compares. thanks.

 

Note 1: You might need to change some configuration (and then revert) to make this new option visible in the xml file

Note 2: Should it turn out that there's no more high CPU usage anymore, then we're getting to the real purpose of that config switch: You will then be able to record the video unprocessed (without timestamp correction). With that recording we'll be able to analyze the cause.

Link to comment
Share on other sites

  • 3 weeks later...
jeffu231

I changed the setting in the system.xml file which I assume is what you were referring to with the server xml. The CPU appears to be lower than before. Not quite, but close to half. Recording only or playing seems to be about the same with the difference of the ffmpeg process. Here are the logs from a recording with the option set to true. Let me know if you need something else.

 

 

embyserver-Legacy_setting.txt

Link to comment
Share on other sites

jeffu231

The emby server is taking about 40-50% now compared to 90% or so before. The ffmpeg process is only a factor when viewing live TV. It seems to be higher at around 20% now compared to previous. The Emby Server process uses about the same whether recording, or watching live TV. 

Link to comment
Share on other sites

I changed the setting in the system.xml file which I assume is what you were referring to with the server xml. The CPU appears to be lower than before. Not quite, but close to half. Recording only or playing seems to be about the same with the difference of the ffmpeg process. Here are the logs from a recording with the option set to true. Let me know if you need something else.

 

 

attachicon.gifembyserver-Legacy_setting.txt

 

I can confirm you successfully configured it.

Link to comment
Share on other sites

  • 2 weeks later...

I wish I had realized this earlier:

 

There is absolutely no issue here. Nothing is wrong at all.

 

@@jeffu231 - You have been subject to misinterpreting the top command output:

 

5da6654e89f39_linux_top.jpg

 

The 110.6% value needs in fact to be divided by the number of cores, which is 8 in your case.

 

That turns 110.6% into 13.8% actual CPU usage.

 

In the third line, we can see 9.9% user space + 3.5% kernel space + 0.5% si = 13.9% --- while 86.0% (id) are unused/idle.

 

What comes on top of that, is that modern CPUs are automatically reducing cycles, clock rates, and a lot of other things to save power. 

With 86% idle cpu, we can assume that such power saving measures were active at that time.

 

Now, those values above do not reflect this. It is just a calculation against the effectively available cycles, not against the full computing capacity of the CPU.

 

What that means in turn, is that those 13.8% are even less - perhaps 10, 5 or 2% percent of the CPUs actual capacity.

 

 

Details may vary, but what's for sure is that there is no problem here at all!

Link to comment
Share on other sites

jeffu231

I understand how top reports, but the issue here is that earlier versions on the same hardware/OS used way less CPU than it is using now with the same reporting. I am making a relative comparison to a change in usage that occurred after upgrading to 4.2. I am not aware of any changes to how top works that would have occurred when I updated to 4.2, so if you believe that 4.2 should use significantly more CPU than the previous versions, then I can accept that is the way it is.

 

Just for interesting comparison purposes, I also have Plex running on the same machine and the same actions use way less CPU under it. Using top in the same manner as I measured for Emby, Plex is able to manage the same actions on 1/10 of the CPU that Emby uses. That usage is similar to what I experienced with Emby before 4.2. I have been comparing and evaluating them side by side for some time now. 

Link to comment
Share on other sites

Q-Droid

While in top 'I' (upper i) toggles Irix mode off/on to show process CPU usage as a % per core (on, default) or % of total capacity (off). Threaded processes can show > 100% in Irix mode. 'H' toggles between process mode (default) and thread mode.

Link to comment
Share on other sites

@@jeffu231

 

So you knew that this was all just about very few percent points? 

 

All this cost us time that we could have spent for more important things.

 

Thanks.

Edited by Luke
Link to comment
Share on other sites

I understand how top reports, but the issue here is that earlier versions on the same hardware/OS used way less CPU than it is using now with the same reporting. I am making a relative comparison to a change in usage that occurred after upgrading to 4.2. I am not aware of any changes to how top works that would have occurred when I updated to 4.2, so if you believe that 4.2 should use significantly more CPU than the previous versions, then I can accept that is the way it is.

 

Just for interesting comparison purposes, I also have Plex running on the same machine and the same actions use way less CPU under it. Using top in the same manner as I measured for Emby, Plex is able to manage the same actions on 1/10 of the CPU that Emby uses. That usage is similar to what I experienced with Emby before 4.2. I have been comparing and evaluating them side by side for some time now. 

 

Keep in mind that they use multiple processes whereas Emby only uses one, so it's not really fair to compare one of their processes to the Emby server process.

Link to comment
Share on other sites

jeffu231

@@jeffu231

 

So you knew that this was all just about very few percent points? 

 

All this cost us time that we could have spent for more important things.

 

Thanks.

 

 

It is way more than a few percentage points. It is using 8-10 times what it used to use before I upgraded to 4.2. Multiply that by multiple streams or recordings and it adds up. But if that is trivial to you, then we live in different worlds. But if that is how you feel, I am fine to cancel my subscription and move on rather than waste anymore of your time and mine. Please excuse me for trying to report my observations to aid in improving the product. As a developer myself I am always interested in my users experiences with the software I write. CPU consumption may not be a big deal for some folks who have money to waste on oversized hardware. I prefer to use that money on other things. There are still some of us that are concerned with writing efficient code that performs well. I started coding when CPU cycles and memory were expensive and you worked hard to manage the resources you used. Maybe that is a lost art these days. 

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