desktop icon indicating copy to clipboard operation
desktop copied to clipboard

CPU usage of "Mattermost Helper" on Mac Desktop app spikes with animated GIFs in view on Mattermost

Open it33 opened this issue 7 years ago • 21 comments

I confirm (by marking "x" in the [ ] below):

  • [x] This is not a feature idea. Feature ideas go here: http://www.mattermost.org/feature-ideas/
  • [x] This is not a troubleshooting question. Troubleshooting questions go here: http://www.mattermost.org/troubleshoot/
  • [x] This is a product defect issue that can be reproduced using the steps listed below.
  • [x] I have read CONTRIBUTING.md.

Jira ticket: https://mattermost.atlassian.net/browse/MM-14109

Summary

CPU usage of "Mattermost Helper" on Mac Desktop app spikes with animated GIFs in view on Mattermost

Steps to reproduce

On Mac OS X 10.10.5 using Mattermost Desktop app 1.2 and Mattermost server 3.2 (master) paste multiple animated GIFs in Mattermost channel and notice CPU utilization of "Mattermost Helper"

Expected behavior

CPU usage should not be extraordinarily high

Observed behavior

CPU usage can spike as high as 66% when animated GIFs are visible, but falls back to normal in channels without animated GIFs.

image

Possible fixes

If you can, link to the line of code that might be responsible for the problem.

it33 avatar Jul 25 '16 20:07 it33

It appears the issue is fixed with Mattermost v1.3. I'll confirm and send a reply back here with the conclusion.

jasonblais avatar Jul 27 '16 23:07 jasonblais

Circling back -- this should now be fixed.

Closing as it cannot be reproduced in desktop app v1.3. Will be re-opened if the issue reappears.

jasonblais avatar Aug 10 '16 12:08 jasonblais

We have received reports that this is still reproducing on Mattermost desktop version 1.3 (and on master).

However, the performance appears to be better than on 1.2.

We should consider options to improve performance in a future release

jasonblais avatar Sep 04 '16 17:09 jasonblais

It seems that having a channel open in Mattermost that has a visible GIF uses CPU even if the user is on another virtual desktop, on Linux. GIFs should only be running if the window is visible to the user.

tmcguire avatar Oct 10 '16 11:10 tmcguire

Thanks for the note @tmcguire!

@yuya-oc, does it sound like a performance improvement on the desktop app or on the Mattermost server?

jasonblais avatar Oct 10 '16 19:10 jasonblais

@yuya-oc Wondering if you could test on Mac whether posting multiple GIFs into a channel still spikes the CPU usage of "Mattermost Helper"?

Also wondering if https://github.com/mattermost/desktop/issues/215 reproduces anymore.

If not, I can go back to the submitter and ask whether they've seen either one since the 3.5 release.

jasonblais avatar Jan 17 '17 15:01 jasonblais

I haven't heard reports of high CPU usage in a while + it's been fine on my end. Closing.

jasonblais avatar Nov 05 '17 00:11 jasonblais

I am seeing this again in OSX desktop client v3.6.0. There is a single animated :clapping: (custom) emoticon.

image

Moving into chat windows without animated emoticons sees the cpu usage drop to nominal values.

jsas avatar Aug 23 '18 00:08 jsas

Thanks @jsas! Can you help download the latest desktop app version (v4.1.2) and see if it reproduces?

You can download the latest version here.

jasonblais avatar Aug 23 '18 00:08 jasonblais

You bet. Same in 4.1.2.

image

jsas avatar Aug 23 '18 00:08 jsas

Thank you!

@yuya-oc Is there any additional information that would be useful in this case?

@jsas Are you able to replicate this behaviour on Google Chrome, or does it only reproduce on the desktop app?

jasonblais avatar Aug 23 '18 11:08 jasonblais

Same in Chrome underpinnings (68.0.3440.106).

I guess this is related to (among a slew of others) https://bugs.chromium.org/p/chromium/issues/detail?id=671138&q=cpu%20animate%20gif&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

image

Although the effects do seem amplified in the desktop client, if that even makes any sense.

jsas avatar Aug 23 '18 18:08 jsas

This is really helpful, thanks @jsas! Apart from the CPU spike, are you noticing it's causing the app itself to slow down?

jasonblais avatar Aug 24 '18 01:08 jasonblais

I have a Windows user on my server (5.7.0, Team edition) complaining that he has to kill his desktop client at least three times a day due to CPU usage spikes. On Linux, with the latest desktop application (but with previous ones as well), I also regularly observe CPU load higher than 10 to 20%. I don't know if this is related to animated images or emoticons, I believe the load is high even when no such images are displayed.

Kabouik avatar Jan 21 '19 13:01 Kabouik

Ticket: https://mattermost.atlassian.net/browse/MM-14109

amyblais avatar Feb 11 '19 17:02 amyblais

Is there any news on this? The issue still stands as of May 2019, and I don't know about Mac but I can confirm CPU usage can be high for both Windows and Linux clients. It's not literally spikes, but 10-20% seems a lot with current CPUs, and Mattermost-client is the most CPU-demanding process when I use my Linux computer for regular use (web browser, IDE, LibreOffice, H.265 videos, etc.).

[Edit] This is not the most striking example since it's only 4.7% here (still something), but one of my users running Windows sent me this:

Image collée à 2019-5-8 18-20

Général - Lamouze is our main channel, and this is the one where we have some animated gifs. Not sure about the other lines, but the channel with gifs doesn't seem to be the main issue.

Kabouik avatar May 08 '19 16:05 Kabouik

To bring grist to the mill:

The same Windows user sent me this today:

Image collée à 2019-5-17 18-35

At the exact same moment, my CPU use with the Linux client was spiking too:

Screenshot from 2019-05-17 18:36:32

Or, another day:

Screenshot from 2019-05-23 14:01:06

Not shown on these screenshots for Linux, but this varies quite a lot and can be worse than that with up to 80% CPU use.

I believe this may relate to videos (or other URLs?) being linked in the channel. The videos are not playing, I just have the previews thumbnails shown, however /collapse does not solve the issue for the Windows client or the Linux client so the previews are probably not the problem. The only solution for the Windows user was to close the client and restart it (I guess because then the URLs to videos will not be shown directly in the history, but rather in the "older messages"). On my side, with the Linux client, this did not help although the videos URLs are hidden in "older messages".

Unfortunately, this kind of CPU levels are making it hard for me to make my users use Mattermost, they want to quit the server and use an alternative, which to be honest can be understood when the CPU use exeeds 65% (my screenshot). This is a shame because I really want our team to keep using open source and self-hosted software, I am very satisfied with Mattermost and want to stick to it, but would need a solution for this bug.

Kabouik avatar May 17 '19 16:05 Kabouik

This may be a webapp issue rather than a desktop app issue and may need to be moved to that repository. See my comment here.

There doesn't initially look like much difference between accessing a server through a conventional web browser vs. through the desktop application which is also just making a web request to the server and loading it into a webview.

Watch the processes on your web browser when accessing the chat server. I suspect you'll observe the same behavior.

hunterlester avatar Sep 16 '19 17:09 hunterlester

I would just like to mention the small detail that setting an animated user status naturally leads to an animated GIF always being displayed, which means that the CPU load of the renderer is constantly at 20% (instead of 0.x%). I was wondering why Mattermost was using CPU unnecessarily and had to find out that my user status was responsible for it. So avoiding animated user status is another workaround to prevent high CPU usage.

pheraph avatar Aug 10 '21 11:08 pheraph

I would like to have a feature to disable animation at all. It will solve the issue.

https://mattermost.uservoice.com/forums/306457-general/suggestions/34520716-ability-to-disable-rendering-of-animated-emoji-or

dshadow avatar Nov 22 '21 19:11 dshadow

I would like to have a feature to disable animation at all. It will solve the issue.

This would also just stop distracting oneself while having a chat window incl. an animation left open on another screen.

eliasgruenewald avatar Jun 28 '22 10:06 eliasgruenewald