Jump to content

Emby server memory usage


parrish

Recommended Posts

Untoten

Yes... Just let the group know when its NOT high...   I'm sure they know of the issue since it has not been posted that there is a fix yet, daily "its still broke" messages don't help the cause. 

This is your first post? Try participating constructively for a bit before telling people what speech is worthy of your reading, perhaps you could post logs.  Until then I will continue to post as I see fit, thanks, enjoy the site! <3

 

@@Untoten and also if you can post a Memory profile with a tool like this... https://www.jetbrains.com/dotmemory/

Could also help us to see what the problem is..

Please include instructions, as I have installed this now on my prod server (only have a 5 day trial apparently).

 

P.S. 12GB this morning.

Edited by Untoten
  • Like 1
Link to comment
Share on other sites

jnheinz

@@Sven - Would you mind explaining to him how to extract the data you need from it?  He is the only one consistently reproducing it.

Link to comment
Share on other sites

parrish

@@Sven - Would you mind explaining to him how to extract the data you need from it?  He is the only one consistently reproducing it.

 

That's not true.  There are many of us that are able to constantly reproduce it.  I've just thrown up my hands and don't want to deal with it anymore- primarily due to the apparent attitude (may not be the case just appears that way) that there is just something unique about our installs and that it's not actually an Emby Server issue (blaming it on plugins, etc).  I just have my Emby Server service configured to automatically reboot every morning as a blunt force workaround.  

  • Like 1
Link to comment
Share on other sites

Sven

You can check the following Youtube "tutorial" -->

You have it installed on a windows machine. And it's running in your processes? So yo can select the Emby process to get all the information..

 

Sorry for the short explanation. Don't have much time to write a big one. But I want to help as much as possible...

  • Like 1
Link to comment
Share on other sites

jnheinz

I think I may be narrowing it down to a specific client/app type.  I only have 2 Roku's (Roku 2 & Roku Stick) connected to my Emby Server, but they are both running Emby Neon Night.  They have coincidentally been idle since I have been unable to reproduce it since removing my automatic service restart.  Last night, one of the Roku's actually got used & I saw a small creep upwards of the memory consumption (prior to streaming content to Emby Neon Night client, 150MB-250MB server task consumption, now 400MB).

 

I will confirm this suspicion late tonight by playing some content from them.

Edited by jnheinz
Link to comment
Share on other sites

Sven

That would be a good moment to monitor the memory..... :)

Attach the profiler to your emby process ....

Link to comment
Share on other sites

Jdiesel

In addition to monitoring memory is anyone able to also monitor active TCP connections? I have been doing some testing where the number of active tcp connections continues to increase as clients access use the server but Emby does not release them once the client disconnects. Eventually the server becomes unresponsive and needs to be rebooted. The behavior seems similar to the memory usage being reported on and I wonder if the two are related or it is a combination of the two.

 

https://emby.media/community/index.php?/topic/49509-established-tcp-ports/

  • Like 2
Link to comment
Share on other sites

Tur0k

I recently added live tv. I had some trouble with CPU utilization. As soon as I got CPU utilization working I had two mornings where after waking up I found that my Emby server service was crashed and the system had a crash warning I couldn't open or view. My system restarts the Emby service daily at 03:45 am. This would indicate that something happened between 03:45 and about 7:00 am. I started monitoring performance and found that after just a few hours Emby server was eating greater than 4GB of my system's RAM. After reading this thread I tried setting blast alive messages to 300 seconds instead of the default 30. This didn't help. I turned blast alive off and can run now through the whole day without moving much higher than 400 MB.

 

 

Sent from my iPhone using Tapatalk

Edited by Tur0k
Link to comment
Share on other sites

@@Tur0k, while the level of detail is nice, we don't know that what you're discussing relates to this topic. For that reason, the best thing to do is follow the steps in how to report a problem and we'll do our best to get you squared away. Thanks !

Link to comment
Share on other sites

bfir3

In addition to monitoring memory is anyone able to also monitor active TCP connections? I have been doing some testing where the number of active tcp connections continues to increase as clients access use the server but Emby does not release them once the client disconnects. Eventually the server becomes unresponsive and needs to be rebooted. The behavior seems similar to the memory usage being reported on and I wonder if the two are related or it is a combination of the two.

 

https://emby.media/community/index.php?/topic/49509-established-tcp-ports/

 

This is something that I might be experiencing actually. I notice Emby becomes increasingly unresponsive the longer I have it open. Today it completely timed out while 4 people were streaming. I couldn't reach the Emby app even though the server was still running. I could reach other apps on my server machine normally without issue. I noticed when this happened that I never receive any response from the server when attempting to connect to it. After about 5 minutes, the server process became responsive and I was able to access my library and people resumed watching, but the issue persisted about an hour later as well.

Link to comment
Share on other sites

Tur0k

@@Tur0k, while the level of detail is nice, we don't know that what you're discussing relates to this topic. For that reason, the best thing to do is follow the steps in how to report a problem and we'll do our best to get you squared away. Thanks !

I have edited my post to only include the memory utilization issue. After turning off the blast alive I am not seeing the memory utilization problem that I was seeing.

 

 

Sent from my iPhone using Tapatalk

Edited by Tur0k
Link to comment
Share on other sites

bfir3

And you checked the open TCP connections? And also the memory, CPU level?

 

I did. There were a lot of TCP connections (don't remember how many at least 30+) but the memory and CPU levels did not seem abnormal (under 25% cpu and less than 2gb memory).

Link to comment
Share on other sites

Jdiesel

I did. There were a lot of TCP connections (don't remember how many at least 30+) but the memory and CPU levels did not seem abnormal (under 25% cpu and less than 2gb memory).

 30+ seems perfectly acceptable. In my situation I have Emby Server holding onto anywhere from 900-1000 connections by the end of the day.

Link to comment
Share on other sites

cw-kid

As I think others have already mentioned, there does seem to be a big difference running the Emby Server as a Windows server service vs running it as the system tray app. 

 

When running it as a service the memory usage is much greater than when running it as the system tray app. 

 

I have disabled the service and started running it in the system tray again for now. 

 

Thanks. 

Link to comment
Share on other sites

MarcusJ

For what its worth.

 

I was having these type of problems. Extreme amounts of memory usage - system slowing down to a crawl; taking a very long time to load screens in the web browser and on my roku devices. Ended up being a corrupt or skewed database - even though I was not getting any database errors I was seeing timeouts because of the length of time it was taking between requests and commands to the server. To fix I changed from a centralized database ; to data and images being saved to the directories - turned off all plugins ; rebuilt by database; turned plugins back on and all problems disappeared. Now I am seeing 2 second or less turnaround times for everything - and no memory issues. Not saying this is your specific problem - but my issues started up without warning and no specific errors in debug logs which pointed me into the right direction. My database before the switch was about 14 gigs in size - which is a lot of data to scan through when the system was processing requests. Its about 700 megs now with the same amount of content

lexisdude, I found your comment while researching how to rebuild my emby server database as I am experiencing a bunch of nagging issues that all seem to point to a corrupted db. 

 

When you say "rebuilt my database" - how do you do that????  Please be specific as I am not very technical.

 

Thank you very much!

  • Like 1
Link to comment
Share on other sites

lexisdude

lexisdude, I found your comment while researching how to rebuild my emby server database as I am experiencing a bunch of nagging issues that all seem to point to a corrupted db. 

 

When you say "rebuilt my database" - how do you do that????  Please be specific as I am not very technical.

 

Thank you very much!

Its not very difficult ; but it can be time consuming for the library to rebuild. In short these are the steps you need to do:

 

1) from the server dashboard / library - click on each of your library icons and tick "Save artwork and metadata into media folders" this is key to stopping the centralized database ; and saving metadata and images to the directories instead.

 

2) From the server dashboard / plugins -  uninstall roku thumbnails

 

3) As others have reported running the server at startup rather than as a service will consume less resources; optional but I suggest to tick "Run server at startup" under server dashboard / settings. If you do this - do make sure that the windows service is turned off. This can be done in windows by Win key+R (or start / run) , typing services.msc in the open dialog and clicking ok. Find "Emby server" in the list ; right click go to properties and change the startup type to disabled.

 

4) delete "library.db" under C:\users\(your username)\AppData\Roaming\MediaBrowser-Server\data\

This directory will obviously be different if you are on a non-windows build; suggest finding out where the file is if your build is different.

 

5) From the server dashboard / Expert / Scheduled Tasks - start "Scan Media Library"

 

Be prepared to wait a good deal of time during the initial scan; and additional time for all your library images/info to repopulate even after the scan as scrapers will continue to pull missing data. It took I think about 14 hours on the initial scan - and an additional day before everything appeared as it should.

 

6) Reinstall and configure your roku plugin under server dashboard/plugins - tick "Save thumbnail files within media folders"

Make sure that "Create thumbnails when videos are discovered" is disabled because this will greatly impact your library scan in the future. The plugin even warns you of this.

 

After all of this - you can go under scheduled tasks and kick off a "Create Thumbnails" - or let it start repopulating based on it's scheduled task. I kicked it off manually the first time just to get it out of the way - then let the scheduler do it thereafter.

 

 

Hope that helps

 

Edited by lexisdude
  • Like 3
Link to comment
Share on other sites

3.5 - Shut down Emby Server

 

4.5 - Start Emby Server

 

5 is probably unnecessary as the server should start this up upon finding no library when it starts.

 

:)

  • Like 3
Link to comment
Share on other sites

pir8radio

3.5 - Shut down Emby Server

 

4.5 - Start Emby Server

 

5 is probably unnecessary as the server should start this up upon finding no library when it starts.

 

:)

 

 

Is it true the database size drops when metadata is stored with media?   Does performance actually increase? Since that moves metadata from a potential SSD to slower spinning media drives or NAS/SAN?    I have always stored my database (C DRIVE) and metadata on an SSD for speed, since my media is stored on a 16TB iSCSI SAN which has slow seek times, i would expect pulling this info to be slower.  My database is only about 2.5GB.  I have what I think is pretty good database performance..   My memory usage has been pretty stable, peaking at about 5 GB.

 

Sorry to sidetrack the topic, the database talk struck me as odd and I was curious. 

Edited by pir8radio
  • Like 1
Link to comment
Share on other sites

Is it true the database size drops when metadata is stored with media?   Does performance actually increase? Since that moves metadata from a potential SSD to slower spinning media drives or NAS/SAN?    I have always stored my database (C DRIVE) and metadata on an SSD for speed, since my media is stored on a 16TB iSCSI SAN which has slow seek times, i would expect pulling this info to be slower.  My database is only about 2.5GB.  I have what I think is pretty good database performance..   My memory usage has been pretty stable, peaking at about 5 GB.

 

Sorry to sidetrack the topic, the database talk struck me as odd and I was curious. 

 

The metadata is only read during a scan.  Whenever the server is delivering data to an app, it is coming out of the database.

  • Like 2
Link to comment
Share on other sites

lexisdude

Is it true the database size drops when metadata is stored with media?   Does performance actually increase? Since that moves metadata from a potential SSD to slower spinning media drives or NAS/SAN?    I have always stored my database (C DRIVE) and metadata on an SSD for speed, since my media is stored on a 16TB iSCSI SAN which has slow seek times, i would expect pulling this info to be slower.  My database is only about 2.5GB.  I have what I think is pretty good database performance..   My memory usage has been pretty stable, peaking at about 5 GB.

 

Sorry to sidetrack the topic, the database talk struck me as odd and I was curious. 

My database size dropped from about 14gb to about 1.05 gb . Memory consumption was around 7gb - now around 2gb . Cannot say for sure that it was not due to corruption; but after the rebuild and decentralizing I personally have noticed a considerable change in response - and in resource usage. 

Edited by lexisdude
  • Like 2
Link to comment
Share on other sites

jnheinz

@@Sven - I tried using that tool, but it was extremely cumbersome & definitely not very intuitive.  Extremely difficult to use it during a period where memory contention is happening, as the tool itself grabs a ton of memory.  There is no method to force a crash/dump of the Emby Server process to a file to be analyzed similar to a kernel dump for a BSOD in Windows or what not?

 

I am back to restarting the service daily.  I will bump my server's version to 3.2.27 tomorrow & disable the daily service restart for awhile.

 

My library.db is 290MB, but I store all my metadata in the media folders, so I am not sure that discussion is entirely relevant.  Fine to bring it up as a question though.

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