Jump to content

Emby Home Page + Menu Load Time - NAS Reboot Start-Up or Hibernation


davidawarner
Go to solution Solved by Happy2Play,

Recommended Posts

Q-Droid

First stop and start the Emby server but not the whole Synology box. This is to see if the inotify errors are not reported in the new log meaning the changed values do get picked up later, pointing to startup order and timing. I don't know why there's a 90 second delay in the command to set those values. It's a long time to wait but also a proven workaround for this issue. Maybe the Synology users in this thread could explain why there is a delay.

You can adjust the delay by lowering the sleep value, in seconds.

Link to comment
Share on other sites

davidawarner
1 hour ago, Q-Droid said:

First stop and start the Emby server but not the whole Synology box. This is to see if the inotify errors are not reported in the new log meaning the changed values do get picked up later, pointing to startup order and timing. I don't know why there's a 90 second delay in the command to set those values. It's a long time to wait but also a proven workaround for this issue. Maybe the Synology users in this thread could explain why there is a delay.

You can adjust the delay by lowering the sleep value, in seconds.

EMBY is hosted on my Synology server so that will be challenge right there. 

I am new user to both platforms Synology and EMBY. I do want to say that the fixes put in place earlier resolved my problem.

Thou still would be good to correct this issue. What to suggest since EMBY is hosted on my Synology server?

tvos 

 

Link to comment
Share on other sites

I don't understand why some people suggest using:

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
sh -c '(sleep 90 && echo 10000 > /proc/sys/fs/inotify/max_user_instances)&'

Remove those two lines and replace them in your startup task with these two lines:

sysctl fs.inotify.max_user_watches=1048576;
sysctl fs.inotify.max_user_instances=4096;

You can adjust the values as needed but those are what I'd suggest you start with.
 

  • Like 2
Link to comment
Share on other sites

davidawarner
1 minute ago, cayars said:

I don't understand why some people suggest using:

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
sh -c '(sleep 90 && echo 10000 > /proc/sys/fs/inotify/max_user_instances)&'

Remove those two lines and replace them in your startup task with these two lines:

sysctl fs.inotify.max_user_watches=1048576;
sysctl fs.inotify.max_user_instances=4096;

You can adjust the values as needed but those are what I'd suggest you start with.
 

with these two values, please explain what this is with EMBY? What is notify and watchers?

sysctl fs.inotify.max_user_watches=1048576;
sysctl fs.inotify.max_user_instances=4096;

please.advise

tvos

 

Link to comment
Share on other sites

8 minutes ago, davidawarner said:

EMBY is hosted on my Synology server so that will be challenge right there. 

I am new user to both platforms Synology and EMBY. I do want to say that the fixes put in place earlier resolved my problem.

Thou still would be good to correct this issue. What to suggest since EMBY is hosted on my Synology server?

tvos 

 

Try making the changes I suggest in the message above this one.
After you change the task, run it which will set the new values.

Restart Emby from the dashboard or stop and start it from Package Center.
Check your logs to see if there are any inotify errors.

If so, let's do a remote support session and get you fixed up.

Link to comment
Share on other sites

Just now, davidawarner said:

with these two values, please explain what this is with EMBY? What is notify and watchers?

sysctl fs.inotify.max_user_watches=1048576;
sysctl fs.inotify.max_user_instances=4096;

please.advise

tvos

 

 

These are iNotify settings which are common in the Linux world.  These are used to be able to receive a message that a file has changed or been added.
This is needed to raise the default 8196 watches limit otherwise Emby won't be able to be notified the file system has changed (RTM).

 

Link to comment
Share on other sites

davidawarner
3 minutes ago, cayars said:

Try making the changes I suggest in the message above this one.
After you change the task, run it which will set the new values.

Restart Emby from the dashboard or stop and start it from Package Center.
Check your logs to see if there are any inotify errors.

If so, let's do a remote support session and get you fixed up.

I will report back my findings.

As for remote, I can setup a zoom session and have you walk my thru steps. 

Thank You

tvos

 

 

  • Like 1
Link to comment
Share on other sites

davidawarner
2 minutes ago, cayars said:

These are iNotify settings which are common in the Linux world.  These are used to be able to receive a message that a file has changed or been added.
This is needed to raise the default 8196 watches limit otherwise Emby won't be able to be notified the file system has changed (RTM).

 

so in other words, I add a video, photo, music RTM will not update the database with these new additions?

tvos

Link to comment
Share on other sites

Just now, davidawarner said:

I will report back my findings.

As for remote, I can setup a zoom session and have you walk my thru steps. 

Thank You

tvos

 

 

Let's hope this is all that's needed.

Otherwise, install TeamViewer which is what I use for remote support.
It can be cleanly un-installed after use.

Link to comment
Share on other sites

Just now, davidawarner said:

so in other words, I add a video, photo, music RTM will not update the database with these new additions?

tvos

Emby has a scheduled task that runs daily.  This would find new files, changed files or files that have been removed.

RTM (real time monitoring) allows Emby to process files a short time after a "change" has taken place.  On Linux/NAS boxes this requires iNotify events.  Microsft Windows has a built in notification system as well only it doesn't need setting limits as Windows simplifies this for you.  Linux on the other hand doesn't try to hold your hand but puts you in control of things like this.  After all, why waist memory on inotify message queues (and many other things) if not being used.  Maybe you just want a small memory footprint Linux Server used for DHCP only and don't need iNotify at all.

Link to comment
Share on other sites

davidawarner

Support Team, 

So here is the latest log and it appears that "iNotify" is not present for errors. I stopped the emby server, updated the settings for the task iNotify then executed. Re-started EMBY server waiting for start-up giving ten minutes for the logs to generate. 

 

Task Scheduler has completed a triggered task.

Task: Inotify Fix for RTM
Start time: Sat, 18 Feb 2023 10:38:11 GMT
Stop time: Sat, 18 Feb 2023 10:38:11 GMT
Current status: 0 (Normal)
Standard output/error:
fs.inotify.max_user_watches = 1048576
fs.inotify.max_user_instances = 4096

 

Let's see through out the day and later when I view the logs if this resolves the problem.

Thank You Emby Team

tvos
 

 

embyserver.txt

Edited by davidawarner
  • Thanks 1
Link to comment
Share on other sites

2023-02-18 10:39:35.779 Info LibraryMonitor: Watching directory /volume1/Video/Health and Exercise
2023-02-18 10:39:35.786 Info LibraryMonitor: Watching directory /volume1/Video/Movies
2023-02-18 10:39:35.802 Info LibraryMonitor: Watching directory /volume1/Video/Music Concerts
2023-02-18 10:39:35.805 Info LibraryMonitor: Watching directory /volume1/Video/Kids
2023-02-18 10:39:35.875 Info LibraryMonitor: Watching directory /volume1/Video/TV Shows
2023-02-18 10:39:35.887 Info LibraryMonitor: Watching directory /volume1/Photos
2023-02-18 10:39:37.678 Info LibraryMonitor: Watching directory /volume1/Music

It looks like the iNotify problem is resolved and all your libraries are being watched using the current settings!

RTM should now be working. Next time you add a new media to the file system in one of the paths mentioned above Emby should start processing it within a few minutes and it will appear in the proper library without you having to do anything.  You should no longer have to wait until the nightly process runs or need to manuallly kick off a library scan.

 

Link to comment
Share on other sites

Just a side note: don’t know if this is true for Synology, but for Ubuntu 22.04 (anyway) you can add:

fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=4096

to /etc/sysctl.conf

this tells the kernel to start with those settling avoiding any startup timing errors.

Link to comment
Share on other sites

Happy2Play
8 minutes ago, TMCsw said:

Just a side note: don’t know if this is true for Synology, but for Ubuntu 22.04 (anyway) you can add:

fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=4096

to /etc/sysctl.conf

this tells the kernel to start with those settling avoiding any startup timing errors.

Online suggests Synology resets these values so a script is needed is my understanding.

Resetting inotify limits (Syncthing) : synology (reddit.com)

https://forum.syncthing.net/t/setting-inotify-limit-permanently-on-synology-diskstation/

 

Edited by Happy2Play
  • Agree 1
Link to comment
Share on other sites

davidawarner

Support,

Can you explain these two values and their numbers. Are these values related to number of files (media, photos, music) or something else!

fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=4096

In the future, will I need to increase these values? Should I run this weekly vs. on boot startup?

Please advise and learning here.

Thank You for quick response and turn around. I am a subscriber to EMBY and will be purchasing the lifetime membership.

Dave

Link to comment
Share on other sites

1 hour ago, davidawarner said:

Support,

Can you explain these two values and their numbers. Are these values related to number of files (media, photos, music) or something else!

fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=4096

In the future, will I need to increase these values? Should I run this weekly vs. on boot startup?

Please advise and learning here.

Thank You for quick response and turn around. I am a subscriber to EMBY and will be purchasing the lifetime membership.

Dave

They're not mapped to anything and are intended to just be really big numbers to reduce the chances of INotify raising this error.

Link to comment
Share on other sites

davidawarner
2 hours ago, Luke said:

They're not mapped to anything and are intended to just be really big numbers to reduce the chances of INotify raising this error.

Thank You... I figured as much but like to know the settings and if needed to adjust in future.

One last question? Should I schedule the task to run monthly, weekly, yearly with reboot or bouncing the EMBY server?

 

 

 

Link to comment
Share on other sites

Happy2Play
6 minutes ago, davidawarner said:

One last question? Should I schedule the task to run monthly, weekly, yearly with reboot or bouncing the EMBY server?

Really a personal preference.

A dev recreated the Restart plugin.  Would have to verify permissions when copying dll to folder on your platform.

Or might get away with a api call.  Just have to generate an api key via App settings-API Keys and adjust url.

 

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