Jump to content

EmbyCon causing high CPU usage


mueslo

Recommended Posts

Hey, I was noticing my NAS has a rather large sustained CPU load while not doing anything of about 25-50% of one CPU core (Xeon E1225v3), caused by the emby-server process. While investigating, I found that the only thing in the logs are queries from EmbyCon.

2018-10-24 17:37:20.102 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 5108ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1
2018-10-24 17:37:46.593 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1. UserAgent:
2018-10-24 17:37:52.177 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 5585ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1
2018-10-24 17:37:56.508 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json. UserAgent:
2018-10-24 17:38:04.628 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 8120ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json
2018-10-24 17:38:05.027 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DatePlayed&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json. UserAgent:
2018-10-24 17:38:13.159 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 8132ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DatePlayed&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json
2018-10-24 17:38:15.552 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1. UserAgent:
2018-10-24 17:38:22.456 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 6905ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1
2018-10-24 17:38:47.465 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1. UserAgent:
2018-10-24 17:38:55.448 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 7983ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&SortBy=Random&IncludeItemTypes=Movie,Series&ImageTypeLimit=1
2018-10-24 17:38:57.120 Info HttpServer: HTTP GET <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json. UserAgent:
2018-10-24 17:39:05.763 Info HttpServer: HTTP Response 200 to <redacted remote embycon client>. Time: 8643ms (slow). <redacted emby address>/emby/Users/dc43057b09bb4291a7ef0d08581095d7/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json

As these query responses seem to be exceedingly slow, I assume they are the culprit. I've also opened htop and watched the growing log output side-by-side, and the time between requests and responses correlates very closely with the times of high CPU usage.

  1. Is it normal that EmbyCon apparently refreshes/syncs the state of the whole media library every 10 seconds without being in use? (Or is it actually just refreshing a single random element as SortBy=Random&limit=1 leads to believe?)
  2. Is it normal that these queries take such a long amount of time?

 

Versions:

Emby 3.5.0.0

Kodi EmbyCon 1.5.43

Edited by mueslo
Link to comment
Share on other sites

What skin are you using? Perhaps the skin is looking for widget update constantly?

 

The RPi running Kodi is with relatives, so I can't test anything locally, sadly. However, as far as I remember from enabling EmbyCon on it, it looked the same as here, so I assume that means no skin.

Edited by mueslo
Link to comment
Share on other sites

or is it just because it is running on a low powered system?

I wouldn't call a 3.5GHz Xeon too low-powered to answer some simply queries, even if it's from 2013 :huh:

 

We'd have to look at the server log.

Well that was the relevant server excerpt.

 

However, good news! I actually just painstaking upgraded from 3.5.0.0 to 3.6.0.57 with a lot of manual experimental recompiling from the FreeBSD 11.2 ports tree in a FreeNAS 11.1 jail, and now the queries only take a few milliseconds like I would have expected.

 

Off-topic: @@Luke, are you super-human? You're always there when I need help, churn out code and never seem to sleep :ph34r:

 

Edit: 3.6 is working great so far, the only issue I have is that plugin updates still have the misspelled "compatability update" message  :lol:

Edited by mueslo
Link to comment
Share on other sites

When idle EmbyCon is producing 4 requests for single items per minute. When I was putting this together that did not sound excessive.

 

Do you think it is worth adding a setting to make this optional? My thoughts on this are if your server can not handle 4 requests per minute there must be issues elsewher

 

Was my assumption correct that the "get background" task randomly updates a single item? If so, why not update more irregularly in bigger chunks? It's not like it's time sensitive like new content.

 

As for the check for new content part, that seems like a better candidate for a variable setting.

Link to comment
Share on other sites

sualfred

@

 

FYI

For the local DB i gather a set of 40 random movie/tvshow items. This set is going to be refreshed after 10 minutes.

 

I never faced issues with your background service, but I could imagine that 100 items could be expensive in this user case.

Link to comment
Share on other sites

highonascii

We are talking about Server side cpu usage not Kodi client side.

I know... I run server as well... I am still saying after a kodi nightly update its not doing it anymore

Link to comment
Share on other sites

highonascii

I can't explain why but that is what happened on my end. I seem to be a lucky one with no "slow down" issue as well. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...