Rocket.chat.electron: The app is using high CPU while idle

Created on 3 Jun 2018  路  22Comments  路  Source: RocketChat/Rocket.Chat.Electron

My Setup

  • Operating System: macOS 10.13.6 (17G31f)
  • App Version: 2.10.5

  • [x] I have tested with the latest version

  • [x] I can simulate the issue easily

Description

The app is using high CPU while idle.

Current Behavior

High CPU usage while idle.

Expected Behavior

Minimal CPU while idle.

performance enhancement

Most helpful comment

A colleague of mine ( @DerFu ) and me did some investigation because we also were confused why Rocket.Chat takes about 5-10% of the CPU when idling.

We found out, that an animation inside the icons.svg is responsible for the CPU usage: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-ui-master/public/icons.svg

Even when opening the file directly inside Google Chrome, the tab takes about 6 to 7% of the CPU (inspectable with the Google Chrome Taskmanager). Removing the animateTransform tag inside the icon-loading icon, results in a CPU usage of ~0% inside the Chrome tab. Also after removing the animation inside the Rocket.Chat DevTools the CPU usage of the Rocket.Chat Helper goes back to nearly 0% when idling.

macOS 10.14.1
Google Chrome 70.0.3538.102
Rocket.Chat 2.14.3

Update:
You should consider using CSS animations instead of SVG animations, because animating SVG via SMIL is deprecated since Chrome 45: https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_animation_with_SMIL

All 22 comments

image

Same for me. RocketChat and RocketChat Helper are almost constantly idling at ~8% of CPU usage.

Same here. Mac OS 10.13.1, Rocket Chat Helper is running at 7-8% all-time.

capture 2018-06-07 a 08 48 23

Same for me:
Mac OS 10.13.5
Client Version: 2.11.0

screen shot 2018-07-02 at 8 56 53 am

There is a dependency on amount of rooms opened.

Same for me. CPU mostly between 15-30% CPU, sometimes 40%+.
I have MacOS 10.13.5
Rocketchat 2.11.0

high-cpu-usage

That's really bad.

any news on this?

Update from us: We updated our self-hosted Rocket.Chat server to version 0.66 and now the CPU usage is below <10% on idle.

But still too high.

Rocket.Chat+ 2.10.5 on macOS 10.12.6 when idle consumes this amount of CPU:

  • 3-4% Rocket.Chat+
  • 5-10% Rocket.Chat+ Helper

Skype for comparison consumes

  • 0,1% when idle

This is a huge difference for battery runtime on Mobile Macs.

I can confirm that on 2.11 on macOS 10.13.5, also, on DevTools Performance tab, there's a lot of repaint on //*[@id="rocket-chat"]/aside/header, //*[@id="chat-window-GENERAL"]/header/div/div[4]/div/div[1]/button and //*[@id="chat-window-GENERAL"]/div/div/div[2]/div[3]

Can confirm for Rocket.Chat+ 2.12.1 on macOS 10.13.5.

screen shot 2018-08-14 at 4 53 38 pm

Any news on this? The desktop client works great for me otherwise, but a 10% idle is a real battery-killer.

@ggazzo I think @schleumer brought valuable info. What do you think about it?

what version of rocket.chat are you using? (rocket.chat "server version")

0.66.3

Same issue here on Windows 10 desktop client 2.12.1 (also on 2.11.0) Lately, seems to run about 5-8% CPU even when idle. Seems to lower usage when avatars are hidden, but only by about 1-2%. Memory around 500-660MB which is really high too for what I would have thought.

I have 5 active channels, in case that matters.
Server version is 0.68.3.

Same for me with v2.11.0. The Rocket.Chat on macOS is permanently consuming at least ~25% CPU, even when it's in the background and no messages are sent.

Here is a typical idle CPU usage (connected to two of our servers with roughly 100 users in total):

Rocket.Chat idle CPU usage

Compared to Slack (where I have 4 teams configured and thousands of users in total):

Slack idle CPU usage

exactly the same here

any news on this?
bildschirmfoto 2018-09-18 um 10 40 53

@weissi29 Some redesign have been made to centralize things in the Rocket.Chat's main process to avoid overhead on renderer processes. Unfortunately, like many performance issues, it is demanded a lot of changes instead of a single correction.

@tassoevan Is there an estimate when the whole package of this necessary changes (also handled in other issues?) is ready, which will impact the CPU load improvement?

@tassoevan Happy to learn more about that as well!

A lot of changes were made in 2.14.0 and 2.14.1 and some platform-specific bug fixes are going to be applied to 2.14.2. Safe to assume that performance improvements will be part of 2.15.0 alongside with proper distribution for Linux users. However, since the autoupdate issues the schedule was lost and it need to be replanned.

A colleague of mine ( @DerFu ) and me did some investigation because we also were confused why Rocket.Chat takes about 5-10% of the CPU when idling.

We found out, that an animation inside the icons.svg is responsible for the CPU usage: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-ui-master/public/icons.svg

Even when opening the file directly inside Google Chrome, the tab takes about 6 to 7% of the CPU (inspectable with the Google Chrome Taskmanager). Removing the animateTransform tag inside the icon-loading icon, results in a CPU usage of ~0% inside the Chrome tab. Also after removing the animation inside the Rocket.Chat DevTools the CPU usage of the Rocket.Chat Helper goes back to nearly 0% when idling.

macOS 10.14.1
Google Chrome 70.0.3538.102
Rocket.Chat 2.14.3

Update:
You should consider using CSS animations instead of SVG animations, because animating SVG via SMIL is deprecated since Chrome 45: https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_animation_with_SMIL

1) Nice to read that this was investigated and animation performance improved.
2) But Rocket.Chat+ 2.15.1 on macOS 10.12.6 still gives me the exact same idle CPU load as before:

  • 3-4% Rocket.Chat+
  • 5-10% Rocket.Chat+ Helper
  • whereas running in Safari only consumes 1-2%
Was this page helpful?
0 / 5 - 0 ratings

Related issues

wrwrwrr picture wrwrwrr  路  4Comments

paulz1 picture paulz1  路  3Comments

bbrendon picture bbrendon  路  4Comments

Vkat14 picture Vkat14  路  4Comments

Sugaroverdose picture Sugaroverdose  路  3Comments