Rocketchat and mongodb high cpu utilization

Description

I installed rocketchat and mongodb in docker with docker-compose, with a single user there is an anomalous use of the cpu by both the container mongodb and rocketchat (more tha 50%)

Server Setup Information

  • Version of Rocket.Chat Server: 3.7.0
  • Operating System: Ubuntu 18.04.5
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.18.4 - x64
  • MongoDB Version: 4.4.1
  • Proxy: nginx
  • Firewalls involved: no

Any additional Information

Some logs from mongodb container:
{“t”:{"$date":“2020-10-03T12:27:37.268+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22237, “ctx”:“TimestampMonitor”,“msg”:“Completing drop for ident”,“attr”:{“ident”:“index-326-1123549052063629803”,“namespace”:“rocketchat.rocketchat_raw_imports”,“dropTimestamp”:{"$timestamp":{“t”:1601728045,“i”:204}}}}
{“t”:{"$date":“2020-10-03T12:27:37.272+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22237, “ctx”:“TimestampMonitor”,“msg”:“Completing drop for ident”,“attr”:{“ident”:“index-327-1123549052063629803”,“namespace”:“rocketchat.rocketchat_raw_imports”,“dropTimestamp”:{"$timestamp":{“t”:1601728045,“i”:204}}}}
{“t”:{"$date":“2020-10-03T12:27:37.272+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22237, “ctx”:“TimestampMonitor”,“msg”:“Completing drop for ident”,“attr”:{“ident”:“collection-325-1123549052063629803”,“namespace”:“rocketchat.rocketchat_raw_imports”,“dropTimestamp”:{"$timestamp":{“t”:1601728045,“i”:204}}}}
{“t”:{"$date":“2020-10-03T12:30:31.275+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:20320, “ctx”:“LogicalSessionCacheRefresh”,“msg”:“createCollection”,“attr”:{“namespace”:“config.system.sessions”,“uuidDisposition”:“generated”,“uuid”:{“uuid”:{"$uuid":“74a687e3-cab3-4fca-8d9b-4733c63fd549”}},“options”:{}}}
{“t”:{"$date":“2020-10-03T12:30:31.276+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:20712, “ctx”:“LogicalSessionCacheReap”,“msg”:“Sessions collection is not set up; waiting until next sessions reap interval”,“attr”:{“error”:“NamespaceNotFound: config.system.sessions does not exist”}}
{“t”:{"$date":“2020-10-03T12:30:31.286+00:00”},“s”:“I”, “c”:“INDEX”, “id”:20345, “ctx”:“LogicalSessionCacheRefresh”,“msg”:“Index build: done building”,“attr”:{“buildUUID”:null,“namespace”:“config.system.sessions”,“index”:“id”,“commitTimestamp”:{"$timestamp":{“t”:1601728231,“i”:2}}}}
{“t”:{"$date":“2020-10-03T12:30:31.286+00:00”},“s”:“I”, “c”:“INDEX”, “id”:20345, “ctx”:“LogicalSessionCacheRefresh”,“msg”:“Index build: done building”,“attr”:{“buildUUID”:null,“namespace”:“config.system.sessions”,“index”:“lsidTTLIndex”,“commitTimestamp”:{"$timestamp":{“t”:1601728231,“i”:2}}}}
{“t”:{"$date":“2020-10-03T12:47:42.198+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:22943, “ctx”:“listener”,“msg”:“Connection accepted”,“attr”:{“remote”:“172.19.0.35:43412”,“connectionId”:19,“connectionCount”:14}}
{“t”:{"$date":“2020-10-03T12:47:42.294+00:00”},“s”:“I”, “c”:“ACCESS”, “id”:20250, “ctx”:“conn19”,“msg”:“Successful authentication”,“attr”:{“mechanism”:“SCRAM-SHA-1”,“principalName”:“root”,“authenticationDatabase”:“admin”,“client”:“172.19.0.35:43412”}}

Some logs from rocketchat container:

  1. at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)
    at packages/nimble_restivus/lib/route.coffee:59:33
    at packages/simple_json-routes.js:98:9
    Unloaded the Apps Framework.
    Exception in defer callback: Error: Connection timeout
    at SMTPConnection._formatError (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
    at SMTPConnection._onError (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:770:20)
    at Timeout. (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:235:22)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
    code: ‘ETIMEDOUT’,
    command: ‘CONN’
    }

I’m also having this same issue, don’t know where to debug.

I solved the problem.

Follow this link https://github.com/RocketChat/Rocket.Chat/issues/19082#issuecomment-701879578

It is necessary to use a new parameter (not mentioned in the guides).

With docker-compose you have to add an environment:

environment:
- USE_NATIVE_OPLOG=true

1 Like

Sorry forgot to reply back, found the solution a while ago.