Jump to content

Emby memory usage while rescanning


Recommended Posts

Posted

Hello,

I'm wondering, what's a normal memory usage for Emby while rescanning libraries?

Posted

Seems like Emby uses a lot of memory, while in the screenshot it is only 22GB, it peaked up to 27GB. My System only has 32GB and runs out of RAM causing CPU_IOWAIT. The OS is forced to use the disk as SWAP.

image.png.c1361556c1e302d531246e500e384603.png

image.png.f76be0436dd9ac6dd31214fbe0950e5b.png

  • Emby Version: 4.7.4.0
  • Docker: 20.10.17
  • Image: LinuxServer.io (I couldn't get your image running with GPU)
  • OS: Debian GNU/Linux 10 64bit / Linux 5.10.0-0.bpo.9-amd64

What I tried:

  • I ran iotop which didn't show that the disk usage was causing the CPU_IOWAIT
  • Tried to set DB buffer to 1024MB
  • Optimized/Vacumized the DB
  • Restarted Emby
  • Issue is gone, when I stop the rescan of the libraries
Posted

Hi there, please attach the emby server log from when this happened. Thanks.

Posted

Hi, will do the update first and rotate the log file. Can I PM you the log?

Posted

Yes you can, although newer versions of the server have log anonymization features.

Posted

Okay, not sure if the problem is gone now, or if the process was already almost finished. it "only" used 3.6GB this time.

I changed two things:

  • Metadata readers - nfo disabled
  • Markers - Generate intro video markers: as a scheduled task and when media is added -> as a scheduled task

Could that be the problem?

 

Sent logs per PM

Posted

Hi, it is normal that the intro detection requires higher resource consumption while it is running, so yes that is possible.

Happy2Play
Posted
6 hours ago, averon said:

Markers - Generate intro video markers: as a scheduled task and when media is added -> as a scheduled task

So you see the same result if your run the "Detect Episode Intros" task?

Posted
33 minutes ago, Luke said:

Hi, it is normal that the intro detection requires higher resource consumption while it is running, so yes that is possible.

Well, it happens on task, which didn't had the same effect before, but now do. I sent you some logs and more information. I don't think that the answer "some task require a bit more performance" is the issue here. Besides the hardware is way above the emby requirements. Like I said in the DM, in 10min about 10GB of memory increase doesn't sound normal. It should be a CPU, DISK and Network (remote storage) heavy task, not memory.

Posted

HI, please try removing the auto-organize and statistics plugins, then restart the server and see how that compares. Thanks.

Posted

Hi,

Already uninstalled statistic plugin, now also removed the auto-organize plugin.

 

What I have noticed is:

  • when Emby takes up so much RAM, I am unable to play anything via Embycon, it starts stuttering immediately and is impossible to watch anything, at the same time via the mobile app or web app it works just normally. (no idea why)
  • when I restart/shutdown Emby via dashboard, it doesn't free-up the memory, I have to restart the container itself

 

Here my docker-compose: In case smh is wrong with it.

image.png.c644d61a0bfe30531e7d9e512737dd1b.png

 

Posted (edited)

Update:

While trying to figure out what could cause my issue, like testing speed between storage and emby, I decided to move emby to another stack. But the new Emby couldn't speak to the graphiccard anymore (before it worked), when using "nvidia-smi" I was notified that the driver couldn't be contacted. ... long story short, the system updated to a new kernel (5.10.0-0.bpo.12-amd64) and the headers were not installed, I installed the new headers, rebooted and the nvidia driver worked again. Now:

  • emby still consumes a lot of ram:image.png.df29434fed3358264b4552477c04763d.png
  • the memory is not used, its cached
    image.png.f6e1fa752570cd242eae5bcbe2e555cd.png
  • the overall performance is way better, It seems, even while running Episode Title Sequence Detection and now 15.7GB memory that I can stream again to embycon
  • the IOWAIT issue is gone image.png.3d8679f274cdd91c1abd9650f28ea6f9.png EDIT: Still exists, when I do Episode Audio Fingerprinting

I came up with the idea, that something else is wrong, cause of another container suddenly having the same behavior as emby, like eating all memory as cache. So right now, I am not really sure, if it's an emby error, but still I any help is apprechiated.

Cheers.

Edited by averon
  • Thanks 1
Posted
47 minutes ago, Q-Droid said:

Thanks alot. This made me freak out :D I once though about smh, because the system didn't stall. But since my headers were missing for whatever reason, the performance was quite wacky. So I forgot about it. Thanks for clarify. Any idea about how to solve the IOWAIT?

Q-Droid
Posted

I/O wait by itself is not all that meaningful. If you think you have a storage bottleneck then utilities like sar, iostat and iotop can help identify the problem.

Posted
12 hours ago, Q-Droid said:

I/O wait by itself is not all that meaningful. If you think you have a storage bottleneck then utilities like sar, iostat and iotop can help identify the problem.

Well, already used that, I guess my bottleneck is the 1Gb connection, even tho I use a bond, I didn't know that a single stream is still limited to 1Gb. Thinking about to remove the bond and using two single connections and split the apps on them. What do you think about it?

Q-Droid
Posted

A 1Gb connection for what, storage? If you're using network storage then you'll have to monitor the storage device itself. If splitting the bond reduces contention between the apps it could help. But if they're using the same storage via different paths you could still run into a bottleneck. Bandwidth is part of the equation along with IOPS and service times. Pushing the limits of what the storage can deliver for any of those introduces waits.

In the end you might be chasing a ghost that started with a false alarm - memory usage.

Posted
4 hours ago, Q-Droid said:

A 1Gb connection for what, storage? If you're using network storage then you'll have to monitor the storage device itself. If splitting the bond reduces contention between the apps it could help. But if they're using the same storage via different paths you could still run into a bottleneck. Bandwidth is part of the equation along with IOPS and service times. Pushing the limits of what the storage can deliver for any of those introduces waits.

In the end you might be chasing a ghost that started with a false alarm - memory usage.

Haha, no I just noticed that the connection is limited at ~100-115MB/s so thats the 1Gb limit, and sometimes even just 80MB/s. I though if I can combine both links, to reach higher speeds. But since you explained that's not working, I decided to split the bond into two seperate connections to have a dedicated one, for emby. and yes storage.

Posted

Hi, are you all set now?

Posted

Yeah I think so, thanks.

  • Thanks 1

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