Setting fs.inotify.max_user_watches values - Keeps resetting

Questions and mods regarding system management may go here
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
stevieboy
I'm New!
I'm New!
Posts: 9
Joined: Mon Jul 20, 2015 7:24 pm

Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by stevieboy » Sat Aug 06, 2016 7:09 pm

Hi,

I am running Crashplan in a docker contatiner on a DS1815+ and noticed with wasn't seeing file changes in real time - When i checked the file watch setting with cat /proc/sys/fs/inotify/max_user_watches it was showing as 8192 which is very low. I set it to a higher value by adding the following line to /etc/sysctl.conf:

fs.inotify.max_user_watches=1048576

If I then run sudo sysctl -p /etc/sysctl.conf then the value is set and all works well. However on a reboot it gets set back to 8192 (the file still shows fs.inotify.max_user_watches=1048576)

Can anyone think how I get this value to stick upon a reboot?

Cheers

davidhbrown
Trainee
Trainee
Posts: 19
Joined: Fri Jul 02, 2010 4:42 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by davidhbrown » Thu Aug 25, 2016 5:09 pm

stevieboy wrote:Can anyone think how I get this value to stick upon a reboot?
Just thought I'd chime in that I'm having this issue with trying to use the GoodSync server on a DS916+ (8G), too.

I saw some references in the man page for sysctl that
Please note that modules loaded after sysctl is run may override the settings (example: sunrpc.* settings are overridden when the sunrpc module is loaded). This may cause some confusion during boot when the settings in sysctl.conf may be overriden. To prevent such a situation, sysctl must be run after the particular module is loaded (e.g., from /etc/rc.d/rc.local or by using the install directive in modprobe.conf)
So, I tried grep sysctl /etc/rc* and saw a few uses but not to change anything in fs.inotify.* There is no modprobe.conf. Seems like packages such as Cloud Station Server, Cloud Station ShareSync, CloudSync, and Hyper Backup would be more likely to use this function and so set the parameter. Maybe Media Server? I've poked around some in /volume1/@appstore/<PackageName>/etc without finding anything suspicious yet. Clues welcome :-)
Current: DS916+ (8GB); Previous: DS410, Buffalo TeraStation. Client OS: Mostly Windows.

stevieboy
I'm New!
I'm New!
Posts: 9
Joined: Mon Jul 20, 2015 7:24 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by stevieboy » Fri Dec 30, 2016 12:28 pm

Hi,

In the end I set up tasks in the task scheduler - One to be run on reboot and the other at 9am every day that simply runs "sysctl fs.inotify.max_user_watches=1048576" as root. Problem solved.

Cheers
Steve

adardia
I'm New!
I'm New!
Posts: 1
Joined: Sat Mar 25, 2017 6:29 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by adardia » Sat Mar 25, 2017 6:31 pm

I've had the same problem w/ it not sticking after a reboot. Thanks for the tip on using a Task Scheduler reboot item to prepare it.

Do you know if its guaranteed that it always runs before the Docker daemon boots up and starts the containers?

User avatar
QWEbie
Beginner
Beginner
Posts: 24
Joined: Sat Jun 10, 2017 11:02 am

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by QWEbie » Tue Nov 07, 2017 3:59 pm

stevieboy wrote:Hi,

In the end I set up tasks in the task scheduler - One to be run on reboot and the other at 9am every day that simply runs "sysctl fs.inotify.max_user_watches=1048576" as root. Problem solved.

Cheers
Steve
Thanks stevieboy! I scheduled it for daily every hour~ How do you set it to run after every reboot??

Was running jrcs/crashplan docker container, but after DSM upgrade to DSM 6.1.4-15217, not only did the Docker app cleared my crashplan settings, after re-creating the docker container, I can't seem to login into Crashplan servers, although nothing has changed on my firewall settings. :shock: :cry:

Moved over to jlesage/crashplan-pro and was able to login! But came into the inotify error. :| Fingers crossed, now waiting for block synchronization to finish after adapting into the old GUID.

For anyone who comes across missing/blank files/folders on the Syno, please add the USER_ID and GROUP_ID as per instructions from jlesage docker page. :D
DS 916+ | x2 4TB WD Red WD40EFRX 5400rpm
DS 916+ | x4 4TB HGST HDN726040 7200rpm | DX513 x2 4TB WD Red WD40EFRX
DS 413j

LucaTony
I'm New!
I'm New!
Posts: 1
Joined: Wed Feb 14, 2018 12:04 am

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by LucaTony » Wed Feb 14, 2018 12:19 am

Since there are apparently some people with this problem I decided to make an account to show you my solution:

sudo vim /usr/local/etc/rc.d/mysycript.sh

paste this:

Code: Select all

#!/bin/sh
if [ $1 = 'start' ]
  then echo 204800 > /proc/sys/fs/inotify/max_user_watches
fi
sudo chmod 755 /usr/local/etc/rc.d/mysycript.sh

reboot and check with cat /proc/sys/fs/inotify/max_user_watches
Hope it helps :)

Hossy
Beginner
Beginner
Posts: 20
Joined: Fri Oct 14, 2011 2:34 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by Hossy » Fri Apr 27, 2018 12:09 pm

/etc/init/s2s_daemon.conf is the culprit for resetting max_user_watches to 8192. You can add "s2s_watches_max=#####" to /etc.defaults/synoinfo.conf and that will override the behavior. Although, keep track of this change because Synology loves to overwrite these files when you do a DSM update. :-) Doing a scheduled task might be the better approach.
Synology DS2411+ 12 x 3TB Seagate ST3000DM001 SHR2 | Remember: RAID is not a backup! I use CrashPlan+.
https://github.com/Hossy | http://serverfault.com/questions/2888/why-is-raid-not-a-backup

User avatar
QWEbie
Beginner
Beginner
Posts: 24
Joined: Sat Jun 10, 2017 11:02 am

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by QWEbie » Wed May 09, 2018 5:00 pm

LucaTony wrote:
Wed Feb 14, 2018 12:19 am
Since there are apparently some people with this problem I decided to make an account to show you my solution:

sudo vim /usr/local/etc/rc.d/mysycript.sh

paste this:

Code: Select all

#!/bin/sh
if [ $1 = 'start' ]
  then echo 204800 > /proc/sys/fs/inotify/max_user_watches
fi
sudo chmod 755 /usr/local/etc/rc.d/mysycript.sh

reboot and check with cat /proc/sys/fs/inotify/max_user_watches
Hope it helps :)
Thanks @LucaTony! The script was a success :lol:
DS 916+ | x2 4TB WD Red WD40EFRX 5400rpm
DS 916+ | x4 4TB HGST HDN726040 7200rpm | DX513 x2 4TB WD Red WD40EFRX
DS 413j

lostinpangea
Trainee
Trainee
Posts: 13
Joined: Thu May 28, 2015 10:07 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by lostinpangea » Tue Jul 10, 2018 9:47 pm

Hello,

I've tried LucaTony's procedure and it seems to work for me (thanks!) in that it changes the inotify watch limit and it seems to stick (as per cat /proc/sys/fs/inotify/max_user_watches), however, I still get the same error!

I've even set the limit to a ridiculously high number (858993459) and I still get the inotify watch limit error. I tried setting it even higher, but it wouldn't accept the value.

I am running a fairly large backup set (~10TB).

Anyone run into this or have any suggestions?

Thank you!
LucaTony wrote:
Wed Feb 14, 2018 12:19 am
Since there are apparently some people with this problem I decided to make an account to show you my solution:

sudo vim /usr/local/etc/rc.d/mysycript.sh

paste this:

Code: Select all

#!/bin/sh
if [ $1 = 'start' ]
  then echo 204800 > /proc/sys/fs/inotify/max_user_watches
fi
sudo chmod 755 /usr/local/etc/rc.d/mysycript.sh

reboot and check with cat /proc/sys/fs/inotify/max_user_watches
Hope it helps :)

User avatar
QWEbie
Beginner
Beginner
Posts: 24
Joined: Sat Jun 10, 2017 11:02 am

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by QWEbie » Thu Aug 16, 2018 4:55 am

Yep. Same here. inotify is updated and sticks, but Crashplan still shows inotify error. :cry:

Probably cause of the new DSM/Docker update?

I'll leave this thread as I'm migrating/offloading the Crashplan install to another system with more RAM... 8)
lostinpangea wrote:
Tue Jul 10, 2018 9:47 pm
Hello,

I've tried LucaTony's procedure and it seems to work for me (thanks!) in that it changes the inotify watch limit and it seems to stick (as per cat /proc/sys/fs/inotify/max_user_watches), however, I still get the same error!

I've even set the limit to a ridiculously high number (858993459) and I still get the inotify watch limit error. I tried setting it even higher, but it wouldn't accept the value.

I am running a fairly large backup set (~10TB).

Anyone run into this or have any suggestions?

Thank you!
DS 916+ | x2 4TB WD Red WD40EFRX 5400rpm
DS 916+ | x4 4TB HGST HDN726040 7200rpm | DX513 x2 4TB WD Red WD40EFRX
DS 413j

lostinpangea
Trainee
Trainee
Posts: 13
Joined: Thu May 28, 2015 10:07 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Unread post by lostinpangea » Fri Sep 07, 2018 6:10 pm

I managed to fix this finally by also changing the allocated memory to 12GB. Hope this helps someone else!

Locked

Return to “System Managment Mods”