limit of inotify

2024-02-02 01:58
文章标签 limit inotify

本文主要是介绍limit of inotify,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本文可解决函数inotify_add_watch发生ENOSPC错误的问题。

-------------------------------------------------------------------------------------------

Problem

When dropbox or guard says like:

  • Unable to monitor filesystem Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.
  • No space left on device - Failed to watch "…": The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource. (Errno::ENOSPC)

Solution

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.

In this case, Dropbox and guard have to use many watches, so do this and increase max_user_watches.

# Check current maximum
$ cat /proc/sys/fs/inotify/max_user_watches
8192
# Increase the maximum
$ echo 100000|sudo tee /proc/sys/fs/inotify/max_user_watches
Password:
100000
# Check
$ cat /proc/sys/fs/inotify/max_user_watches
100000

Doing the above increases max_user_watches temporally.

To increase max_user_watches at boot, edit /etc/sysctl.conf and add fs.inotify.max_user_watches=100000 or fix fs.inotify.max_user_watches= to 100000.

(Note: I’m using gentoo so some other distros may have another way to do this…)


本文转自:http://blog.sorah.jp/2012/01/24/inotify-limitation

这篇关于limit of inotify的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/669148

相关文章

【matlab 求极限】limit函数求极限

syms x;y1=(4*x^3-2*x^2+x)/(3*x^2+2*x);limit(y1,x,0) >> syms x;y1=(4*x^3-2*x^2+x)/(3*x^2+2*x);limit(y1,x,0)ans =1/2>>

报错:Reached the max session limit(DM8 达梦数据库)

报错:Reached the max session limit - - DM8 达梦数据库 1 环境介绍2 数据库启动SYSTEM IS READY后面日志3 数据库刚启动日志4 达梦数据库学习使用列表 1 环境介绍 某项目无法连接数据库,报错:超过最大会话数限制 , 检查 dmdba ulimit -a openfiles 已改检查 dm.ini 其中 MAX_SESSION

GC overhead limit exceeded : Spark

我在运行Spark程序的时候报错 java.lang.OutOfMemoryError:GC overhead limit exceeded 伴随着通常有: java.lang.OutOfMemoryError:Java heap spaceorg.apache.spark.shuffle.FetchFailedException:Failed to connect to ... 这是

Orderby limit offset分页

SELECT * FROM table_name WHERE some_column = #{value} ORDER BY id LIMIT #{limit} OFFSET #{offset} // 假设你已经配置了 SqlSession try (SqlSession session = sqlSessionFactory.openSession()) { // 调用 countTotal

.NetCore+vue3上传图片 Multipart body length limit 16384 exceeded.

实现目标。点击图片上传头像 效果图 前端部分图片上传关键代码 <div class="avatar-wrap"><el-imagestyle="width: 154px; height: 154px":src="form.headPic":fit="fit"/></div><div class="upload-box"><el-uploadclass="avatar-uploader":

MySQL 单表分页 Limit 性能优化

主要针对记录非常多的表 常用分页sql语句: select * from product limit start, count 当起始页较小时,查询没有性能问题,我们分别看下从10, 100, 1000, 10000开始分页的执行时间(每页取20条), 如下: select * from product limit 10, 20 0.016秒select * from product

分页场景(limit, offset)为什么会慢?

点击上方“朱小厮的博客”,选择“设为星标” 后台回复"书",获取 后台回复“k8s”,可领取k8s资料 从一个问题说起 五年前发现分页场景下,mysql请求速度非常慢。数据量只有10w的情况下,select xx from 单机大概2,3秒。我就问我导师为什么,他反问“索引场景,mysql中获得第n大的数,时间复杂度是多少?” 答案的追寻 确认场景 假设status上面有索引。select *

(7)inotify实时同步

(7)inotify实时同步 inotify 是一种强大的,细粒度的,一步的文件系统事件监控机制。 inotifywait -mrq --timefmt '%d%m%y %H:%M' --format '%T %w%f' -e create /backup

SQL的优雅节制:使用LIMIT精控查询结果数量

SQL的优雅节制:使用LIMIT精控查询结果数量 在数据库查询中,我们经常需要限制返回的数据量,以优化性能或仅展示部分数据。SQL的LIMIT子句正是为此而生,它允许开发者精确控制查询结果的数量。本文将深入探讨LIMIT子句的用法,并通过代码示例展示如何利用它来优化SQL查询。 LIMIT子句简介 LIMIT子句是SQL标准的一部分,用于限制SELECT查询返回的行数。它常用于分页显示数据或

已解决**Java OutOfMemoryError: GC Overhead Limit Overload - 问题分析与解决方法**

在 Java 中,遇到此java.lang.OutOfMemoryError: GC overhead limit exceeded错误可能是一种具有挑战性的体验,尤其是在处理管理大型数据集或具有长时间运行的进程的应用程序时。此错误表明 Java 虚拟机 (JVM) 花费了太多时间执行垃圾回收 (GC),但无法释放足够的内存来继续处理。 在这篇博客中,我们将深入探讨导致此错误的原因、如何诊断此错