High CPU Usage
I have Ubuntu 14.04 with RocketChat installed. When multiple users log's in the CPU load is high, where the node application uses more CPU which is about 102%.
CPU core - 8 RAM - 9 GB - only 1 GB utilized.
Any comments would be much appreciated.
Thanks.
Please post a screenshot of top with the 1 key clicked ... displaying all the loads of the different cores.
What CPU model is it? I'm running my instance on two L5420 CPUs, albeit via KVM virtualization. My CPU usage is very low, but my memory usage is rather high (over 5GB). That's likely because I run it in "development mode" (e.g git pull followed by meteor).
How are you running your instance? Docker?

UPDATE This peaked for about 15 minutes, then settled back down at around 5-15% usage. We're running Ubuntu 14 inside a Xen server instance. Unsure, but the instance seems to correlate with a user attempting to start a group video chat on the Default channel, which had 83 users in it at the time (since disabled that feature).
Numerous restarts - both the docker container, then moved back to the source package running under pm2 - and a reboot did not resolve the issue. Also tried clearing the rocketchat_message collection with no impact.
The issue self-resolved after about 15 minutes or so.
Attaching the top screen shot
I have installed Rocket Chat wihtout docker, and running the application by settting up the environment variables with ROOTURL, MONGOURL and PORT post that nohup node manin.js & to capture the log in a out file.
@saigop - just for our information. You mentioned ... then moved back to the source package running under pm2 ... how were you starting Rocket.Chat when the 100% CPU incident occurred?
I generally used to start nohup node main.js & form the RocketChat folder. Currently am not using pm2, this is fresh installation.
@Sing-Li - I think you were referring to my post. We were using the Docker container, both latest and develop were showing this issue. I grabbed from source as a last-ditch effort - I had the PM2 config set up from a pre-docker experimentation - and it was experiencing the same issues.
Haven't had any serious issues with this since then, unless the service is restarting due to #1967
Thanks @saigop and @jeffrapp. This is likely a difficult to reproduce bug or config related one. Please try to gather as much console log as possible should this happen again. Thanks again for all the help!
@saigop and @jeffrapp -- Can you please post the version info from:
https://your-rocketchat-host/api/info
Similar to:
{
"version": "0.15.0",
"compile": {
"date": "2016-01-28T15:51:11.777Z",
"nodeVersion": "v0.10.40",
"arch": "x64",
"platform": "linux",
"osRelease": "3.13.0-52-generic",
"totalMemmory": 8373084160,
"freeMemmory": 193224704,
"cpus": 4
},
"commit": {
"hash": "cd829c3f92ab6ef2bca8270afbfddadf2ad7eacc",
"date": "Thu Jan 28 13:46:48 2016 -0200",
"author": "Rodrigo Nascimento",
"subject": "Disable WebRTC broadcastStatus"
},
"tag": "0.15.0",
"branch": "develop",
Thanks!
{
"version": "0.15.0",
"compile": {
"date": "2016-01-29T21:46:05.147Z",
"nodeVersion": "v0.10.40",
"arch": "x64",
"platform": "linux",
"osRelease": "3.16.0-59-generic",
"totalMemmory": 8363171840,
"freeMemmory": 4472664064,
"cpus": 4
},
"commit": {
"hash": "b5c9a8a45ed4faf9314ccfebf0ce2a2ca4d64fb0",
"date": "Fri Jan 29 16:52:37 2016 -0200",
"author": "Rodrigo Nascimento",
"subject": "Add sort for all queries with limit"
},
"tag": "0.15.0",
"branch": "develop",
"GraphicsMagick": {
"enabled": true,
"version": "GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/\nCopyright (C) 2002-2013 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details.\n\nFeature Support:\n Thread Safe yes\n Large Files (> 32 bit) yes\n Large Memory (> 32 bit) yes\n BZIP yes\n DPS no\n FlashPix no\n FreeType yes\n Ghostscript (Library) no\n JBIG yes\n JPEG-2000 yes\n JPEG yes\n Little CMS yes\n Loadable Modules no\n OpenMP yes (201107)\n PNG yes\n TIFF yes\n TRIO no\n UMEM no\n WMF yes\n X11 yes\n XML yes\n ZLIB yes\n\nHost type: x86_64-pc-linux-gnu\n\nConfigured using the command:\n ./configure '--build' 'x86_64-linux-gnu' '--enable-shared' '--enable-static' '--enable-libtool-verbose' '--prefix=/usr' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--docdir=${prefix}/share/doc/graphicsmagick' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts' '--with-x' '--x-includes=/usr/include/X11' '--x-libraries=/usr/lib/X11' '--without-dps' '--without-modules' '--without-frozenpaths' '--with-perl' '--with-perl-options=INSTALLDIRS=vendor' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-Wall -g -fno-strict-aliasing -fPIE -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2' 'LDFLAGS= -fPIE -pie -Wl,-z,relro -Wl,-z,now ' 'CXXFLAGS=-Wall -g -fno-strict-aliasing -fPIE -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2'\n\nFinal Build Parameters:\n CC = gcc -std=gnu99\n CFLAGS = -fopenmp -Wall -g -fno-strict-aliasing -fPIE -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wall -pthread\n CPPFLAGS = -I/usr/include/X11 -I/usr/include/freetype2 -I/usr/include/libxml2\n CXX = g++\n CXXFLAGS = -Wall -g -fno-strict-aliasing -fPIE -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -pthread\n LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now -L/usr/lib/X11 -L/usr/lib -L/usr/lib\n LIBS = -ljbig -llcms2 -ltiff -lfreetype -ljasper -ljpeg -lpng12 -lwmflite -lXext -lSM -lICE -lX11 -llzma -lbz2 -lxml2 -lz -lm -lgomp -lpthread\n"
},
"ImageMagick": {
"enabled": false
}
}
Had this happen again today. Nothing specific in the logs - is there a way to turn up the verbosity?
Thanks, @jeffrapp. This is very useful information. Unfortunately no way to change the verbosity at the moment.
Sorry for my delayed reply, mine is,
{ "version": "0.10.2", "compile": { "date": "2015-12-22T21:49:50.737Z", "nodeVersion": "v0.10.40", "arch": "x64", "platform": "linux", "osRelease": "3.13.0-63-generic", "totalMemmory": 7844462592, "freeMemmory": 5134458880, "cpus": 2 }, "travis": { "buildNumber": "2769", "branch": "master", "tag": "" }, "commit": { "hash": "99403fed7028093fed8f54f49690f78d80ff7f36", "date": "Tue Dec 22 19:45:02 2015 -0200", "author": "Gabriel Engel", "subject": "bump version to 0.10.2" }, "tag": "v0.10.2", "branch": "HEAD", "GraphicsMagick": { "enabled": false }, "ImageMagick": { "enabled": false } }
one more update, for last 48 hours, i didn't expect CPU load, since i have killed the service and started the rocket via pm2 and moreover not much user online. But my RAM usage is high, rocket chat node service uses 3 GB.
@saigop and @jeffrapp ... did either (or both) of you enabled the optional rocketchat-hubot package?
@saigop - you are running a VERY OLD version of Rocket.Chat. You may want to update soon.
no hubot was added in mine.
I do have hubot installed, unsure if it was running at the time as we've been more or less testing with that aspect of the system.
From this morning, I noticed, my CPU usage and RAM usage got reduced automatically, not sure what happened, I not even restarted, but let me keep monitoring. By the way only few members are using, anyways let me keep monitoring.
Is anyone still experiencing this kind of problem? Can we close this issue?