# Rocketchat and mongodb high cpu utilization

**URL:** https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755
**Category:** Community Support
**Created:** [October 3, 2020, 1:00pm UTC](https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755 "2020-10-03T13:00:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zedred79](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zedred79](https://forums.rocket.chat/u/zedred79)
#### Post date: [October 3, 2020, 1:00pm UTC](https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755/1 "2020-10-03T13:00:16Z")

</div>

### 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’  
}

---

<div class="post-metadata">

### Author: ![cim](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/cim/32/1928_2.png) [@cim](https://forums.rocket.chat/u/cim)
#### Post date: [October 5, 2020, 4:50am UTC](https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755/2 "2020-10-05T04:50:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![zedred79](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zedred79](https://forums.rocket.chat/u/zedred79)
#### Post date: [October 5, 2020, 4:11pm UTC](https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755/3 "2020-10-05T16:11:22Z")

</div>

I solved the problem.

Follow this link [https://github.com/RocketChat/Rocket.Chat/issues/19082#issuecomment-701879578](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**

---

<div class="post-metadata">

### Author: ![cim](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/cim/32/1928_2.png) [@cim](https://forums.rocket.chat/u/cim)
#### Post date: [October 6, 2020, 4:49am UTC](https://forums.rocket.chat/t/rocketchat-and-mongodb-high-cpu-utilization/8755/4 "2020-10-06T04:49:12Z")

</div>

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