High RAM consumption on Ubuntu

Hello,
we have RocketChat running on the following system

Server Setup Information

  • Version of Rocket.Chat Server: 3.13.2 (the latest version at the moment on SNAP)
  • Operating System: Ubuntu 18.04
  • Deployment Method: SNAP
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 12.21.0
  • MongoDB Version: 3.6.14
  • Proxy: caddy
  • Firewalls involved: yes

The Server is running as vmware vm and we have around 30-40 online users.
The Server has 6 CPUs and 10GM RAM.

Is it a normal behavior, that almost all RAM is used? The system requirements on the RocketChat Docu shows the following information (1000 Users, 300 concurrently active)

  • Intel Xeon E5-2603 v4 (or equivalent) [1.7 GHz, 6 cores, $213 USD]
  • 4 GB RAM
  • 500 GB hard disk or larger
  • Ubuntu 18.04 LTS (with or without docker

We are far away from 300 concurrently active users and all 10GB RAM is used

We have 10GB Ram because the old Version 3.6.2 had a lot of memory leak errors and the server was not responding after some uptime.

It would be great if someone can tell me if this RAM consumption is normal or how we can handle this.
Thanks and best regards

1 Like

I think the requirements are probably a bit old these days. We need to review them (doing that now!)

Are you on a barebones server, a VM or something else?

Are you using GridFS for storage? I would get that out of your DB ASAP. It adds a lot of overhead. There is a script around to help with that.

If you are going to scale you probably want to move off snaps to something more flexible too. Snaps are fine for a simple setup, but don’t scale well. You should probably look at docker.

Hi John,
thanks for your reply.

We use a VM (vmware 6.5).

Yes at the moment we are using GridFS for storage.
I would like to change it to “local system”.

Can i do this like this:
Set the config to “filesystem” and set the path for the file system to /var/snap/rocketchat-server/common/upload. Then set the permission for this folder to 755 and root:root?

The script you mentioned is necessary to migrate uploaded files in the GridFS to the local filesystem, right?

In the future i will look to migrate away from snap but at the moment i have to fix the RAM problem first.
Thank you very much!

EDIT: Do you mean this script for migration?

Yes - that should do it!

gridfsmigrate - yes that is the one.

Make sure you have GOOD BACKUPS before you attempt all this please!!

Hi John,

just one question - i’m trying to run the script and i have to set the source database name.
What is the default gridfs database name? Is it rocketchat or is it different?

Thanks and best regards

Snap db is called ‘parties’ I think.

Everything else uses ‘rocketchat’

And a quick note from a dev on the Ram requirements.

“Yes, it can use a ton of RAM. Remember it is running Mongo in there”

As I mentioned above, snaps are great for a simple install but they run out of steam pretty fast if you intend to scale.

Hi John,
thanks a lot.

The script was running fine and i moved all uploads to the filesystem.
Next Step is to migrate away from snap.

Is there any “best practice” how to for doing that? Can i transfer all data from snap to e.g. docker or a manuall ubuntu installation?

What is the best solution for a scalable solution - docker?
Thanks and best regards

The script was running fine and i moved all uploads to the filesystem.
Perfect.

Yes I’d say docker is your best bet - it is just easier. You could do a manual install which could be a little more flexible and probably a bit less resource intensive. YMMV.

I actually run docker with a ‘real’ mongo instance rather than a dockerized one.

Is there any “best practice” how to for doing that?

I’m not sure - if not I need to write one!!

Make sure you backup thoroughly first - it is amazing how many people don’t.

Next, set up a test install. Make sure it is exactly the same version as the snap. Both the Rocket version and the mongo version.

As you know, the collections can get modified between versions so if we import to a different version than the one we exported from we can get in a mess.

If you are going to run a lot of users you can run multiple mongo replica sets, and even split the presence collection to another DB.

Get this prepared first.

Get your snap backup, open up the file and change the collection name from ‘parties’ to ‘rocketchat’ and then save. You can then import this to your new mongo instance.

After that you should be on your way. Test, a lot. Once you are happy you can look at upgrading Mongo and/or Rocket.Chat

Clearly there could be more detail here, but those are the basics.

Hope that helps - ask if you have further questions.

Are you on a barebones server, a VM or something else?

Kodi nox