lang/node

linux watcher limit on pm2

C/H 2019. 11. 21. 11:11

watcher Error

PM2              |     at NodeFsHandler._addToNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:620:21)
PM2              | Error: ENOSPC: System limit for number of file watchers reached, watch '/home/ubuntu/project/nexus2/node_modules/entities/lib/encode.js'
PM2              |     at FSWatcher.start (internal/fs/watchers.js:165:26)
PM2              |     at Object.watch (fs.js:1329:11)
PM2              |     at createFsWatchInstance (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:118:15)
PM2              |     at setFsWatchListener (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:165:15)
PM2              |     at NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:330:14)
PM2              |     at NodeFsHandler._handleFile (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:360:23)
PM2              |     at NodeFsHandler._addToNodeFs (/usr/local/lib/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:620:21)

It’s hitting your system's file watchers limit

시스템 감시자 한계 도달

Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.

Listen은 Linux에서 기본적으로 inotify를 사용하여 디렉토리 변경 사항을 모니터합니다. 모니터링 할 수있는 파일 수에 대한 시스템 제한이 발생하는 것은 드문 일이 아닙니다. 예를 들어, Ubuntu Lucid (64 비트) inotify 한도는 8192로 설정되어 있습니다.

You can get your current inotify file watch limit by executing:

다음을 실행하여 현재 inotify 파일 감시 제한을 얻을 수 있습니다.

$ cat /proc/sys/fs/inotify/max_user_watches

When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.

이 한계가 디렉토리 내의 모든 파일을 모니터하기에 충분하지 않은 경우 청취가 제대로 작동하려면 한계를 늘려야합니다.

You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

If you like to make your limit permanent, use:

한도를 영구적으로 유지하려면 다음을 사용하십시오.

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining.

Listen이 계속해서 불평하는 경우 `max_queued_events` 및 `max_user_instances` 값에주의를 기울여야 할 수도 있습니다.

반응형

'lang > node' 카테고리의 다른 글

Joi Validation  (0) 2021.02.10
javascript: 교집합(Union), 합집합(Intersection), 여집합(difference, minus)  (0) 2021.01.21
pm2 npm start  (0) 2019.11.14
NPM Permission Error  (0) 2019.11.13
jwtwebtoken  (0) 2019.04.12