-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unreasonably high CPU usage when idling #5444
Comments
Are you really using v5.7? Can you update if that's the case? |
Oh, it was from the ubuntu repos. Now i'm on v5.12.2 but i see the same behaviour. Mostly 4%-5% CPU usage after start and minimized. |
From your logs, I'm not sure where you read 4 to 10%, but even then, there's no baseline which Signal-Desktop should reach (FWIW it's always less than 4% on my computer according to htop). The lower the better, and whatever can be done to lower this should indeed be done, but there's little that's actionable from this issue. |
i read the cpu usage from htop as well. Btw i just kept it running without changing anything and it now is around 8% cpu usage. There are multiple signal-desktop processes in htop and if i add thier cpu usage i even get a lot over 10%. There maybe no objective baseline. But for me subjectivly this is too much. I lot more such idling applications and the cpu (or one cpu) is fully loaded. What is it that signal-desktop is doing if there is nothing happening. Other messengers don't need that much resources. For comparison, my email client uses 0.0% when idling according to htop, just like every 10 seconds there is a spike of 1% or so. As i said i also don't really know what to make of the strace/ltrace logs. This was just a starting point. I don't know any other way to see what signal-desktop is doing other that study the code. What is your cpu usage? Maybe there is something special with my setup if other people don't see this behavior. |
Also another way to look at the cpu usage is, not to compare it to the 100% possible but to the rest that is currently used. When my computer is idle and im reading a website(and other apps closed) i have roughly 4% or less on each of the 4 CPU cores. If an app uses 8% than it is already half of what all other processes are using. Therefore this makes a huge difference how long my notebook battery lasts if i'm just reading. |
Can you add a debug log? |
This is the debug log: |
@wohltat we believe this is fixed in 5.13.x can you please upgrade? |
There seems to be an improvement. Shortly after start of signal-desktop there is around only 1% cpu usage. But after ten minutes or so, it looks almost like before. So it didn't change much. |
I had a closer look when the increase in cpu usage happens. The last four times i looked at the time even closer and it was pretty much exactly 2:07min after signal was launched. Could it be that there is some timer that is initialized on program start (7 seconds after launch) that triggers something after 2 minutes? |
I started signal at 20:35:01. in the log there is
i tried again at 20:43:00
From exclusion and because other message have been there before, the rise in CPU usage could be connected to "getAllFromCache" and "getAllFromCache loaded 0 saved envelopes" whatever that means. |
Hah, very interesting. Could you post your debug log or send it over email to me ([email protected])? I'm looking for something like: "slow query getUnprocessedCount" or "slow query getAllUnprocessed", but it might be something else! |
Nvm, it loaded zero saved envelopes. Interesting... |
This code path runs every 2 minutes. Do you see CPU spikes every 2 minutes or just once 2 minutes after app restart? |
I haven't figured out the pattern just yet. I'm about to make a recording of the CPU usage. Sometimes its low for a while and then its high for at least several minutes. |
I don't know why but now the behavior is different. The rise in cpu usage is not appearing after 2 minutes but later. Here is a plot of the 1 minute average CPU usage over some hours. The CPU load of all signal processes where summed up. Code to create the plot: from pylab import *
import pandas as pd
import psutil
import time
from time import sleep
sp = [p for p in map(psutil.Process, psutil.pids()) if p.name().find('signal-desktop')!=-1]
cpu_usage = []
while True:
cpu_usage.append([time.time()] + [p.cpu_percent() for p in sp])
sleep(0.1) # 0.1 = 100ms resolution
# manually interrupted the loop here after some time
%pylab notebook
# code for plotting the results
df = pd.DataFrame(cpu_usage, columns=['time'] + [p.pid for p in sp])
x = pd.to_datetime(df.time * 1e9) # time in ns
cpu_usage_all_processes = df.iloc[:,2:].sum(axis=1)
y = cpu_usage_all_processes.rolling(10*60).mean()
h = plot(array(x), array(y))
_ = plt.xticks(rotation=45)
ylabel('CPU usage [%]') |
I'm not entirely sure what's going on. The logs that you sent to me doesn't show any activity during that time on our end. The most work that we've done at that point was running a db query once per minute and sending a keepalive message to the server once per minute too. The query didn't take long time to run, and keepalive is generally inexpensive so I don't see how any of these could have triggered a high-CPU usage. Did you happen to have a conversation open with GIFs running, or something that would use a lot CPU power to redraw UI often? |
There wasn't anything happening and nothing open until around 10:45 when you can see a bit of turbulence in the graph. I can do a long time recording of the cpu usage similar like the one i posted if this would help you. |
Happens for me too, Drains battery a lot |
@wohltat we just released 5.14.0 which has some fresh performance improvements. Could you give it a try and see if it helps at all? |
I have 5.13.0 installed on Ubuntu 21.04 and also see 10% CPU usage while Signal is idle. That is too much. It's 3 times more than firefox that I currently use to write this comment. Why is the issue closed ? The problem is not at all resolved. |
@wohltat @chmike @alien2003 What we need is more information from you - we need you to be scientists. What I see when Signal Desktop is in the background is 0.1-0.3% CPU usage, so details from your configuration are really important. I've opened the issue again - please let us know everything you can about how the behavior changes. The increase over time as the app is used after startup is really interesting. Does it change if you close the conversation with Ctrl+Shift+C to close the current conversation so no conversation is showing? What if you don't send any messages, just open a conversation with 30+ messages in it? How about opening a conversation with no messages in it? That's the kind of information that may lead to a fix. Thanks! |
@scottnonnenberg-signal What would you do if if this would happen on you computer? Which tools would you use? I made another longer test. The interesting thing is that this time it was low for several hours. Then i opened signal, opened some conversations, ctrl+shift+c and then minimized it again. After that cpu usage stayed high again. log file around the time cpu load rose up again
complete logs: |
I'm running signal-desktop 5.54.0 and I would say the issue seems to be resolved for me, thank you :) |
not solved for me on version v5.62.0 (linux Mint) Clean start. No open chats. No open windows. Platform InfoSignal Version: Operating System: Linked Device Version: |
Adding my discovery to this issue: I get a much lower idle CPU usage on version 5.60.0, but if I update to 5.61.1 I start getting around 5% CPU when idling, so something seems to have changed between these two versions. If I switch between these two versions the problem appears/disappears. 5.62.0 also exhibits the same problem. I'm running: |
I'm currently (5.62.0) seeing 5% cpu usage on debian bullseye when idle (minimized). Updated to 5.63.1: Now at <= 1% cpu usage when idle (minimized) |
Very similar here. But no after restart of Signal. I started to be happy a
few months ago but just because after restart as well as a few hours later
everything was ok. But I let my system run nonstop for several months. Few
days ago I noticed again that Signal doing nothing and using 40% of one CPU
core.
For me it is strange. There has been a real problem for over one year. What
is Signal doing? Instead of fixing it they started to focus on removing SMS
support from Signal ....
All together for me it is a strong signal to stop supporting Signal and
start to look around ...
Jozef
…On Thu, Nov 10, 2022 at 1:34 PM Axel Dyks ***@***.***> wrote:
I'm currently seeing 5% cpu usage on debian bullseye when idle (minimized
to tray). And this is on an AMD CPU with 8 cores = 16 threads. Which means
it's almost an entire thread (90%). This is *very bad!*
But my feeling is that the actual cause is somewhere deep in electron ...
or in other words: There is little hope unless signal gets rid of this
monster.
—
Reply to this email directly, view it on GitHub
<#5444 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIZB6BVOA6YX5VDZDZCVN3WHTTXDANCNFSM5BWWERWQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@scottnonnenberg-signal: Here is a debug log from 5.60.0 (where I don't have the issue): https://debuglogs.org/desktop/5.60.0/1760593d7adc53c5f910960c53168f421ccff47ded99edd6995350095be37946.gz And from 5.63.1 (where I have the issue): https://debuglogs.org/desktop/5.63.1/c1577ecea8b6dafb6fed9fe752ba59422d60da38b65c859f7bd9236b61444d84.gz
strace for 5.60.0:
strace for 5.63.1
The Let me know if there is any other specific information I can provide! |
I'm seeing a similar problem with Electron apps. On macOS the process "Signal Helper (Renderer)" idles at 3% with all windows closed and "Discord Helper (Renderer)" also idles at 3% with all windows closed. edit: This was observed on macOS 11.7.1 using Signal 5.63.1 I tried building Signal with the latest versions of Electron 21.3.0 and 22.0.0-beta.6 but the issue was still there. However I am not seeing this issue when using the electron app "Electron Fiddle". The "Electron Fiddle Helper (Renderer)" idles at 0% with the window open, but I'm not certain if the issue is with a part of electron or with how it is being used. |
@habbbe we just released a new beta version (v6.0.0-beta.1). Could you try installing it and running the binary with |
@indutny-signal I tried the v6.0.0-beta.2, but it still gave me the same idle CPU usage. Adding or removing the |
I don't know whether this is for sure related, but I err on the side of not opening a new issue :) If I leave the priorities set that way, the rest of my system slows down a little. But more importantly, my OBS, which is often running a stream for a large audience with an Above Normal priority single process, begins to glitch. Even with Signal totally idle, nothing really happening, my livestream begins to choke up and I am dropping hundreds of frames. CPU usage still shows as under 10%, and resource meters show everything I can think of is 2%-50% utilized; nothing above that. OBS is set to use a different GPU than Signal for rendering, but nonetheless, rendering is stuttery. I find if I then do this: After that, OBS works perfectly, 0 dropped frames, and Signal seems totally responsive and perfectly usable for sending/receiving texts. No perceivable difference in performance, but OBS is now happy. What in the living. Thanks, by the way. I do love Signal and use it all the time. |
It didn't. This is usual for Chromium and Electron apps, and not something bad in itself. |
I guess I never noticed. Thanks for the correction :) |
OK,
few days waiting and it's again here. Signal Desktop is doing nothing and
15-18% of CPU.
https://debuglogs.org/desktop/5.63.0/e42aff75b6c08663816d7726c1e07ebbde7c447b81c246a01fc0c7f9288fdfa4.gz
…On Wed, Dec 7, 2022 at 1:38 PM therentabrain ***@***.***> wrote:
I guess I never noticed. Thanks for the correction :)
—
Reply to this email directly, view it on GitHub
<#5444 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIZB6EOP6WMSYBBLHXC5IDWMCALDANCNFSM5BWWERWQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is somehow solved for me. Version 6.0.1 just 3-4% idle. |
ok, thanks, sorry. I am still on the old version. Upgrading ....
…On Fri, Dec 9, 2022 at 11:11 AM mac-linux-free ***@***.***> wrote:
This is somehow solved for me. Version 6.0.1 just 3-4% idle.
—
Reply to this email directly, view it on GitHub
<#5444 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIZB6FMMUW2YWOEPM7KZCDWMMAU7ANCNFSM5BWWERWQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Just reporting in that I'm still seeing 4-6% CPU when idle with 6.1.0. |
This is still on our radar and we are trying to figure out what's going on. If y'all could send additional debug logs, that'd be very appreciated! Could anyone on this thread try running profiler on it? I think perf is the recommended tool for it nowadays? If someone here is on macOS - could you try profiling it using CPU Profiler in the Instruments.app that comes with Xcode? Sorry, I know I'm asking for lots of details, but what we need to make progress on this is information! Thanks! |
See also issue #4459. |
I can report that I'm seeing very low CPU usage (0-0.5%) when idling now. I could only test this back to 6.6.0, but the same is true for 6.8.0. For me this seems to be solved! |
Same here, Ubuntu 22.10. Very low CPU usage now. |
Same here on Arch Linux. |
Same here. Low CPU usage (less than 1%, where I could see more than 10% before) |
Thanks for all your reports, everyone. I'm going to close this. Future folks: Please enter a new bug if you see this behavior again. |
Bug Description
signal-desktop is constantly using around minimum 4% CPU on my computer even it is in the background and nothing is happening.
Steps to Reproduce
i just start signal-desktop via command line
signal-desktop
and minimize it.Actual Result:
4%-10% or more CPU usage in idle state. This around as much or more than my window manager uses.
Expected Result:
1% or less CPU usage.
Platform Info
Signal Version:
v5.7.1
Operating System:
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20.1
Release: 20.1
Codename: ulyssa
Linux 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linked Device Version:
Android Version: 6.0.1
strace, ltrace
profiling for 10seconds of app running
Most time is spend in library calls and not in syscalls. I still don't really know how to interpret this since with 4% CPU usage over 10s should be something like 0.4 seconds.
The text was updated successfully, but these errors were encountered: