Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Subsequent versions of rocketchat are regressing on snappiness

Open vikaskedia opened this issue 10 years ago • 14 comments

Your Rocket.Chat version: .24

Hats off to a great piece of engineering,

At our organization:

  1. The users love the features of rocketchat
  2. The management loves the privacy/owning its own data

BUT, I am getting pushback from users that rocketchat is not as snappy to use as slack.

I have done the following settings to pare rocket chat down:

  1. Administration -> Messages -> Embeds -> False
  2. Administration -> Messages -> Audio recorder enabled -> False
  3. Rocket chat is running on a server with 128GB of RAM and 32 CPU cores. screen shot 2016-03-31 at 6 31 36 pm

Any recommendations on what I can do to make rocketchat snappy to use ?

vikaskedia avatar Apr 01 '16 01:04 vikaskedia

@vikaskedia first off glad to hear that your users love our features :+1:

Regarding speed. What kind of user load are you running? Also Rocket.Chat being based on Meteor and Node.js is single threaded so its only making use of a single Thread.

Are you running just one instance of Rocket.Chat on your server? On our demo server we have 4 cores and have 4 instances of Rocket.Chat running.

If you don't want to public share more of your setup, I fully understand. Please feel free to hit me up on our demo server(@ aaron.ogle). I'd love to help you get increased performance! :smile:

geekgonecrazy avatar Apr 01 '16 02:04 geekgonecrazy

Please if possible keep the discussions here, causes I think it would be valueable information for others...

lunitic avatar Apr 01 '16 06:04 lunitic

@vikaskedia you really need to run multiple process, 1 per core is ideal when you have 100s of users.

engelgabriel avatar Apr 01 '16 18:04 engelgabriel

@engelgabriel does it exist any doc/tutorial regarding scaling?

lunitic avatar Apr 02 '16 07:04 lunitic

+1

I'd love to see the demo deployment details as a case study. There are lots of vanilla meteor scaled deployment posts out there (nginx -> HAProxy, etc) but it would be nice to know how you chose to do it for RC.

rebeld avatar Apr 02 '16 14:04 rebeld

@vikaskedia did you manage to run multiple instances?

engelgabriel avatar Apr 04 '16 14:04 engelgabriel

We are running https://lisk.chat with approx. 1300+ users, and 80+ actively online. Our number of users has grown quite rapidly, and performance is beginning to be a problem.

Currently the instance is running on one CPU core. Does anyone have any pointers on how to proceed with configuring my deployment to take advantage of multiple cores?

Can https://github.com/meteorhacks/cluster be used in this case?

My deployment is on a Ubuntu server, based on these docs:

https://rocket.chat/docs/master/installing-and-updating-2-deployment-options-ubuntu

FYI, I am using pm2 for process management.

Any pointers or help would be much appreciated, as I would really like to learn the best practices for scaling our deployment. Thanks.

karmacoma avatar Apr 14 '16 11:04 karmacoma

@karmacoma what version of RC are you using? We have just release a new refactoring on the streams on the develop branch that improves the CPU load significantly. But we have a much bigger improvement coming soon.

Are you using Nginx with PM2?

engelgabriel avatar Apr 14 '16 15:04 engelgabriel

@engelgabriel We are currently using 0.25.0. Yes, we are using Nginx and PM2.

karmacoma avatar Apr 14 '16 15:04 karmacoma

If you set up your PM2 config json like the example: https://github.com/RocketChat/Rocket.Chat/blob/develop/example-pm2.json You can configure you NGINX like:

upstream demo.rocket.chat {
    server localhost:8080 weight=1;
    server localhost:8081 weight=1;
    server localhost:8082 weight=1;
    server localhost:8083 weight=1;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    server_name demo.rocket.chat;
    return 301 https://demo.rocket.chat$request_uri;
}

server {
    listen 443 default_server;
    listen [::]:443 default_server ipv6only=on;
    server_name demo.rocket.chat;
    root /var/www/rocket.chat/bundle/programs/web.browser/app/;
    ssl on;
    ssl_certificate /var/www/rocket.chat/ssl/demo/demo.rocket.chat.chained.crt;
    ssl_certificate_key /var/www/rocket.chat/ssl/demo/demo.rocket.chat.key;
    ssl_ciphers         'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
    ssl_prefer_server_ciphers on;
    ssl_dhparam         /etc/nginx/dhparams.pem;
    client_max_body_size 32m;
    proxy_buffering off;
    proxy_http_version 1.1;
    proxy_read_timeout 600;
    proxy_send_timeout 600;
    proxy_set_header   Host              $host:$server_port;
    proxy_set_header   Referer           $http_referer;
    proxy_set_header   X-Real-IP         $remote_addr;
    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto https;
    proxy_set_header   Upgrade           $http_upgrade;
    proxy_set_header   Connection        "upgrade";
    proxy_set_header   X-Nginx-Proxy     true;
    proxy_redirect     off;
    location / {
        proxy_pass     http://demo.rocket.chat;
    }
}

engelgabriel avatar Apr 14 '16 17:04 engelgabriel

@engelgabriel Thank you! Very much appreciated 👍

karmacoma avatar Apr 14 '16 17:04 karmacoma

Darn I was hoping for a docker-compose variation... But thanks for that!!

mrplow avatar Apr 14 '16 23:04 mrplow

@vikaskedia is your DB running in ReplicaSET mode? THIS IS THE MOST IMPORTANT REQUERIMENT

engelgabriel avatar Apr 14 '16 23:04 engelgabriel

This information on this thread is already added to our docs. Thanks for your contributions!

engelgabriel avatar Jan 19 '17 19:01 engelgabriel