Rocketchat 6.6.3 too many open files error

Description

Hi everyone, recently my rocketchat server upgrade from v6.4.4 to v6.6.3 after that, sometime user feedback they using rocketchat client hang, keep loading chatroom, after i restart the rocketchat service it will back to normal, i have checked the log file “EMFILE: too many open files” and searched some article said that need increase the File Descriptor Limits, but unfortunely this still happened.

May i know what i should check? or any other i can provide?

lsof | awk ‘{print $2}’ | sort | uniq -c | sort -nr | head -n 10
67824 10117 /usr/bin/mongod -f /etc/mongod.conf
4268 18478 /var/www/html/rocket.chat/main.js

ulimit -n
65535

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System: CentOS7.9
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: -
  • NodeJS Version: 14.21.3
  • MongoDB Version: 5.0.23
  • Proxy: Nginx
  • Firewalls involved: -

Any additional Information

this is the log file:

nodejs-example: {“level”:35,“time”:“2024-05-12T14:33:09.491Z”,“pid”:21746,“hostname”:“rocketchat-01”,“name”:“Meteor”,“method”:“UserPresence:online”,“userId”:“XKiQzywbHAtk8vfDu”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/3.9.11 Chrome/108.0.5359.215 Electron/22.3.27 Safari/537.36”,“remoteIP”:“2.2.2.2”,“instanceId”:“62109b1a-e34f-4a20-b2d3-5e173002d74af”}

nodejs-example: {“level”:35,“time”:“2024-05-12T14:33:21.043Z”,“pid”:21746,“hostname”:“rocketchat-01”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/users.presence?ids=38pqhN2pKGjbWAbje&ids=XSQWcwCALwRwB6dEATp&ids=XKiQzywbHAtk8vfDu”,“userId”:“XKiQzywbHAtk8vfDu”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/3.9.11 Chrome/108.0.5359.215 Electron/22.3.27 Safari/537.36”,“host”:“1.1.1.1”,“referer”:“https://1.1.1.1/group/xxxxxxx",“remoteIP”:“3.3.3.3”,“status”:200,"responseTime”:1}

nodejs-example: {“line”:“711”,“file”:“webapp_server.js”,“message”:“Error serving static file Error: EMFILE: too many open files, open ‘/var/www/html/rocket.chat/programs/web.browser/289805353bb3b85260a22026ac4a278076ae340c5.css’”,“time”:{“$date”:1715524402340},“level”:“error”}

nodejs-example: {“line”:“711”,“file”:“webapp_server.js”,“message”:“Error serving static file Error: EMFILE: too many open files, open ‘/var/www/html/rocket.chat/programs/web.browser/ea5e20b2313c1b92567f09c4887baf8c7b6dfe3a7.js’”,“time”:{“$date”:1715524402364},“level”:“error”}

Hmm. Not seen this before.

First, upgrade to the latest 6.6.x

Second have a read online:

“Error serving static file Error: EMFILE: too many open files, open”

Eg