Skip to content

Agent run out of system notify watchers

Error code

SE_FS_TOO_MANY_SUBSCRIPTIONS

Agents use system file watchers to be notified of files updates. The error message appears in Synchronization Jobs and is frequent for a Linux OS, especially if there are lot of files and subdirectories in the synced folder. If the agent process hits the system's limit of watchers, the Agent won't be notified about file update and thus the only way for it to learn about these is by rescanning the folder, either manually or periodically. It's better to increase the watchers limit.

By default, system allocates 8192 watchers. Run the command to check that and see the output

cat /proc/sys/fs/inotify/max_user_watches

There are two ways to increase it. In either case, XXXXX is the number of watchers you'd like to set. Do not set amount of watchers more than 2147483647. Also note that majority Linux distributions can only support up to 524288 watchers even if you configure more.

Increase the number of watchers temporarily

Note

The increased number of notify watchers is preserved only until the computer is rebooted.

To temporarily increase the number of notify watchers:

  1. In the Terminal run:

    sudo sysctl fs.inotify.max_user_watches=XXXXX
    
  2. Ensure that the number has increased:

    cat /proc/sys/fs/inotify/max_user_watches
    
  3. Restart the Agent.

Increase the number of watchers permanently

Linux

To permanently increase the number of workers on Linux:

  1. Run the two commands:

    echo fs.inotify.max_user_watches=XXXXXX | sudo tee -a /etc/sysctl.conf  
    sudo sysctl -p
    
  2. Recheck that the number has indeed increased:

    cat /proc/sys/fs/inotify/max_user_watches
    
  3. Restart the Agent.

Synology NAS

To permanently increase the number of workers on a Synology NAS device:

  1. Log in to Synology DSM.
  2. Open the Control Panel and click Task scheduler.

    Synology Control Panel

  3. Select Create > Triggered Task > User-defined script.

    Synology Task Scheduler

  4. In the General tab:

    1. Provide a name for your scheduled task.
    2. From the User drop-down list, select root.
    3. From the Event drop-downl list, select Boot-up.

      Synology Create Task General

  5. In the Task Settings tab, in the Run command section, enter the following line:

    sysctl fs.inotify.max_user_watches=524288
    

    Synology Create Task Settings

  6. Reboot your NAS device.

QNAP NAS

To permanently increase the number of workers on a Qnap NAS device:

  1. Establish SSH connection to your NAS device.
  2. Follow instructions in the Running Your Own Application at Startup guide to mount the configuration volume.
  3. Add the script increasing watchers to the /tmp/config/autorun.sh file:

    echo -en "echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf\nsudo sysctl -p\n" > /tmp/config/autorun.sh
    
  4. Apply execute permission and run the autorun.sh:

    chmod +x /tmp/config/autorun.sh && /tmp/config/autorun.sh
    
  5. Unmount the config volume:

    umount /tmp/config
    
  6. Open QNAP WebUI, navigate to Control Panel -> Hardware -> General, then select the Run user defined processes during startup option and click Apply.

    4405615536915