{"id":1045,"date":"2017-06-01T14:59:11","date_gmt":"2017-06-01T13:59:11","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=1045"},"modified":"2017-06-01T15:01:04","modified_gmt":"2017-06-01T14:01:04","slug":"lysncd-fails-error-terminating-since-inotify-watches","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2017\/06\/01\/lysncd-fails-error-terminating-since-inotify-watches\/","title":{"rendered":"Lysncd fails with Error: Terminating since out of inotify watches."},"content":{"rendered":"<p>This is a remarkably easy problem to solve. <\/p>\n<p>From man:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nThe inotify API provides a mechanism for monitoring filesystem\r\n       events.  Inotify can be used to monitor individual files, or to\r\n       monitor directories.  When a directory is monitored, inotify will\r\n       return events for the directory itself, and for files inside the\r\n       directory.\r\n\r\n<\/pre>\n<p>The problem is a kernel based value, that determines how much memory is used by processes such as lsyncd. Lets just double check what value it is set to presently:<\/p>\n<h2> Check Inotify max_user_watches value presently <\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;root@server php]# cat \/proc\/sys\/fs\/inotify\/max_user_watches\r\n100000\r\n<\/pre>\n<h2> Check the amount of available memory on the server to ensure it can deal with the increase <\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;root@server-new php]# free -m\r\n             total       used       free     shared    buffers     cached\r\nMem:          7358       6577        781          1        376       2427\r\n-\/+ buffers\/cache:       3773       3584\r\nSwap:            0          0          0\r\n<\/pre>\n<p>The cache can be added to free, as a maximum saturation. Linux uses lots of memory it doesn&#8217;t really need for efficiency.<\/p>\n<p>Each used inotify watch uses 1 kB RAM in 64 bit systems, for 32bit its half.<\/p>\n<h2> Increase Inotify watches to a higher value <\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsysctl fs.inotify.max_user_watches=200000\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a remarkably easy problem to solve. From man: The inotify API provides a mechanism for monitoring filesystem events. Inotify can be used to monitor individual files, or to monitor directories. When a directory is monitored, inotify will return &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2017\/06\/01\/lysncd-fails-error-terminating-since-inotify-watches\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,107,9,64,108],"tags":[],"class_list":["post-1045","post","type-post","status-publish","format-standard","hentry","category-bash","category-kernel","category-linux","category-lsyncd","category-sysctl"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1045"}],"version-history":[{"count":2,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1045\/revisions"}],"predecessor-version":[{"id":1047,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1045\/revisions\/1047"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}