[HOW TO] lsyncd: Error, Consider increasing /proc/sys/fs/inotify/max_user_watches | lsyncd dead but pid file exists

hello,

30 minutes ago, I go around our server to ensure the data synchronization runs day-by-day. But ...
It is not run 3 days ago.

What happened?

Ok, step-by-step

Check lsyncd:
[root@01 ~]# /etc/init.d/lsyncd status
lsyncd dead but pid file exists

Huh-uh,
[root@01 ~]# less /var/log/lsyncd/lsyncd.log
lsyncd: Error, Consider increasing /proc/sys/fs/inotify/max_user_watches

How to fix?

$ echo 524288 > /proc/sys/fs/inotify/max_user_watches

man inotify(7) says:
The following interfaces can be used to limit the amount of kernel memory consumed by inotify:
/proc/sys/fs/inotify/max_queued_events 
The value in this file is used when an application calls inotify_init(2) to set an upper limit on the number of events that can be queued to the corresponding inotify instance. Events in excess of this limit are dropped, but an IN_Q_OVERFLOW event is always generated.
/proc/sys/fs/inotify/max_user_instances 
This specifies an upper limit on the number of inotify instances that can be created per real user ID.
/proc/sys/fs/inotify/max_user_watches 
This specifies an upper limit on the number of watches that can be created per real user ID.

Restart lsyncd
[root@01 ~]# /etc/init.d/lsyncd restart
Stopping lsyncd:                                           [FAILED]
Starting lsyncd:                                           [  OK  ]
[root@01 ~]# 
[root@01 ~]# /etc/init.d/lsyncd status
lsyncd (pid  605) is running...

Hope this help!

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

1 comment:

  1. I faced the same issue and it resolved by increasing the max watch (y). Thanks for sharing....

    ReplyDelete