# Moved to v6 and now facing lag

**URL:** <https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211>\
**Category:** Community Support\
**Created:** [March 15, 2023, 1:09am UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211 "2023-03-15T01:09:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisw83](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@chrisw83](https://forums.rocket.chat/u/chrisw83)\
**Post date:** [March 15, 2023, 1:09am UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/1 "2023-03-15T01:09:26Z")

</div>

### Description

Prior to moving to v6 everything ran flawlessly. This isnt a constant issue but it happens a lot. When sending a message (private or to a channel) it will take a second or two for the message to load. Uploading images now takes a long time.

I do not know how to check the logs inside docker to see if there is any issues popping up.

### Server Setup Information

- Version of Rocket.Chat Server: 6.0.0
- Operating System: Ubuntu Latest
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: MongoDB 5.0.15 / wiredTiger (oplog Enabled)
- NodeJS Version: v14.21.2
- MongoDB Version: MongoDB 5.0.15 / wiredTiger (oplog Enabled)
- Proxy: nginx
- Firewalls involved: disabled

### Any additional Information

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 15, 2023, 5:24pm UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/2 "2023-03-15T17:24:27Z")

</div>

Hi! Welcome back 🙂

You can check the logs from WORSPACE \> LOGS, inside Rocket.Chat

or, go to where you rocket.chat docker-compose.yml i and issue:

`docker compose logs -f --tail 10`

also, you can check the resource comsuption by issuing:

`docker stats`

this can give you a clue about the resource usage for each container.

---

<div class="post-metadata">

**Author:** ![chrisw83](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@chrisw83](https://forums.rocket.chat/u/chrisw83)\
**Post date:** [March 15, 2023, 8:25pm UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/3 "2023-03-15T20:25:06Z")

</div>

I used the log command docker compose logs -f --tail 10 and it seems like the bot I had installed (Remind Me) was causing some issues. I removed that but did get this message in the logs

```auto
rocketchat_1 | This instance could not remove the Add Reminder app package. If you are running Rocket.Chat in a cluster with multiple instances, possibly other instance removed the package. If this is not the case, it is possible that the file in the database got renamed or removed manually.

```

How can I make sure that this was completely removed?

Also I am getting these 2 messages also

> mongodb\_1 | {“t”:{“$date”:“2023-03-15T20:20:55.933+00:00”},“s”:“I”, “c”:“COMMAND”, “id”:51803, “ctx”:“conn36”,“msg”:“Slow query”,“attr”:{“type”:“command”,“ns”:“parties.rocketchat\_uploads.chunks”,“command”:{“find”:“rocketchat\_uploads.chunks”,“filter”:{“files\_id”:“qvNKCMSTC6vbjTbfC”},“sort”:{“n”:1},“limit”:0,“lsid”:{“id”:{“$uuid”:“0991f0d0-08a0-43e9-b366-bd4430e8a746”}},“$clusterTime”:{“clusterTime”:{“$timestamp”:{“t”:1678911648,“i”:1}},“signature”:{“hash”:{“$binary”:{“base64”:“AAAAAAAAAAAAAAAAAAAAAAAAAAA=”,“subType”:“0”}},“keyId”:0}},“$db”:“parties”},“planSummary”:“COLLSCAN”,“keysExamined”:0,“docsExamined”:12514,“hasSortStage”:true,“cursorExhausted”:true,“numYields”:30,“nreturned”:11,“queryHash”:“9FE7AF15”,“planCacheKey”:“7D04618B”,“reslen”:2765910,“locks”:{“FeatureCompatibilityVersion”:{“acquireCount”:{“r”:31}},“Global”:{“acquireCount”:{“r”:31}},“Mutex”:{“acquireCount”:{“r”:1}}},“storage”:{“data”:{“bytesRead”:235442021,“timeReadingMicros”:115614}},“remote”:“192.168.0.8:48654”,“protocol”:“op\_msg”,“durationMillis”:423}}

> mongodb\_1 | {“t”:{“$date”:“2023-03-15T20:21:20.419+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1678911680:419460][1:0x7f4f41c9f700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 131168948, snapshot max: 131168948 snapshot count: 0, oldest timestamp: (1678911380, 2) , meta checkpoint timestamp: (1678911680, 2) base write gen: 2254800”}}

---

<div class="post-metadata">

**Author:** ![chrisw83](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@chrisw83](https://forums.rocket.chat/u/chrisw83)\
**Post date:** [March 15, 2023, 8:31pm UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/4 "2023-03-15T20:31:05Z")

</div>

Looks like mongo is using a ton of ram

NAME CPU % MEM USAGE / LIMIT MEM %  
rocketdocker\_rocketchat\_1 26.83% 677.1MiB / 31.13GiB 2.12%  
rocketdocker\_mongodb\_1 4.58% 16.74GiB / 31.13GiB 53.79%

I did the logs and found that the reminder bot I had installed was causing some issues. I removed that and I will see if that helps with the lag issues.

Are these 2 issues that I need to look into as well?

> mongodb\_1 | {“t”:{“$date”:“2023-03-15T20:20:55.933+00:00”},“s”:“I”, “c”:“COMMAND”, “id”:51803, “ctx”:“conn36”,“msg”:“Slow query”,“attr”:{“type”:“command”,“ns”:“parties.rocketchat\_uploads.chunks”,“command”:{“find”:“rocketchat\_uploads.chunks”,“filter”:{“files\_id”:“qvNKCMSTC6vbjTbfC”},“sort”:{“n”:1},“limit”:0,“lsid”:{“id”:{“$uuid”:“0991f0d0-08a0-43e9-b366-bd4430e8a746”}},“$clusterTime”:{“clusterTime”:{“$timestamp”:{“t”:1678911648,“i”:1}},“signature”:{“hash”:{“$binary”:{“base64”:“AAAAAAAAAAAAAAAAAAAAAAAAAAA=”,“subType”:“0”}},“keyId”:0}},“$db”:“parties”},“planSummary”:“COLLSCAN”,“keysExamined”:0,“docsExamined”:12514,“hasSortStage”:true,“cursorExhausted”:true,“numYields”:30,“nreturned”:11,“queryHash”:“9FE7AF15”,“planCacheKey”:“7D04618B”,“reslen”:2765910,“locks”:{“FeatureCompatibilityVersion”:{“acquireCount”:{“r”:31}},“Global”:{“acquireCount”:{“r”:31}},“Mutex”:{“acquireCount”:{“r”:1}}},“storage”:{“data”:{“bytesRead”:235442021,“timeReadingMicros”:115614}},“remote”:“192.168.0.8:48654”,“protocol”:“op\_msg”,“durationMillis”:423}}

> mongodb\_1 | {“t”:{“$date”:“2023-03-15T20:21:20.419+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1678911680:419460][1:0x7f4f41c9f700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 131168948, snapshot max: 131168948 snapshot count: 0, oldest timestamp: (1678911380, 2) , meta checkpoint timestamp: (1678911680, 2) base write gen: 2254800”}}

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 16, 2023, 2:36pm UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/5 "2023-03-16T14:36:13Z")

</div>

this slow query message… looks like it is having a hard time finding this file\_id qvNKCMSTC6vbjTbfC upload chunk.

The second log message doesn’t look like a problem.

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![chrisw83](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@chrisw83](https://forums.rocket.chat/u/chrisw83)\
**Post date:** [March 18, 2023, 1:54am UTC](https://forums.rocket.chat/t/moved-to-v6-and-now-facing-lag/16211/6 "2023-03-18T01:54:49Z")

</div>

Thanks @dudanogueira I have everything resolved. I used this thread to get the database files resolved

> <https://github.com/RocketChat/Rocket.Chat/issues/24266>
>
> We have an issue after upgrading our Rocket.Chat install to the latests, server …/ client and MongoDB (see versions below)
> 
> After upgrading, first to wiredTiger, then to version 4.2 / 4.4 then 5.0 all attachments added to chats i.e. images / audio / video etc take an inordinate amount of time.
> Also clicking on these attachments also take an inordinate amount of time to show or start playing.
> By inordinate I mean 3 - 5 minutes to show images or upload new attachments as oppose to just a few seconds previously.
> None of our attachments are particularly large and affect ALL existing attachments (viewing) and new attachments (upload and or view)
> 
> \### The stack trace
> I get the following stack traces in the Rocket.Chat logs which seems to indicate a missing parameter OR missing indexes. Any ideas how to fix this will be appreciated..
> 
> ufs: cannot read file "mC3nrWQ3cY7ifoJwz" (Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting.) MongoError: Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting.
> at MessageStream.messageHandler (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/cmap/connection.js:272:20)
> at MessageStream.emit (events.js:314:20)
> at MessageStream.EventEmitter.emit (domain.js:483:12)
> at processIncomingData (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/cmap/message\_stream.js:144:12)
> at MessageStream.\_write (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/cmap/message\_stream.js:42:5)
> at doWrite (\_stream\_writable.js:403:12)
> at writeOrBuffer (\_stream\_writable.js:387:5)
> at MessageStream.Writable.write (\_stream\_writable.js:318:11)
> at Socket.ondata (\_stream\_readable.js:718:22)
> at Socket.emit (events.js:314:20)
> at Socket.EventEmitter.emit (domain.js:483:12)
> at addChunk (\_stream\_readable.js:297:12)
> at readableAddChunk (\_stream\_readable.js:272:9)
> at Socket.Readable.push (\_stream\_readable.js:213:10)
> at TCP.onStreamRead (internal/stream\_base\_commons.js:188:23)
> at TCP.callbackTrampoline (internal/async\_hooks.js:126:14) {
> ok: 0,
> code: 292,
> codeName: 'QueryExceededMemoryLimitNoDiskUseAllowed',
> '$clusterTime': {
> clusterTime: Timestamp { \_bsontype: 'Timestamp', low\_: 2, high\_: 1642705737 },
> signature: { hash: \[Binary\], keyId: 0 }
> },
> operationTime: Timestamp { \_bsontype: 'Timestamp', low\_: 2, high\_: 1642705737 }
> 
> \### Server Setup Information:
> 
> \- Version of Rocket.Chat Server: 4.3.2
> \- Operating System: Ubuntu 20.04
> \- Deployment Method: Docker
> \- Number of Running Instances: 1
> \- DB Replicaset Oplog: --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger (single instance replica set)
> \- NodeJS Version: v12.22.8
> \- MongoDB Version: 5.0.5
> \- Using GridFS for file storage
> 
> \### Client Setup Information
> 
> \- Desktop App or Browser Version: Both
> \- Operating System: Multiple
> 
> 
> Steve
