Skip to content
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

Slow startup time #6604

Open
1 task done
mmahmoudian opened this issue Sep 13, 2023 · 29 comments
Open
1 task done

Slow startup time #6604

mmahmoudian opened this issue Sep 13, 2023 · 29 comments
Labels

Comments

@mmahmoudian
Copy link

mmahmoudian commented Sep 13, 2023

  • I have searched open and closed issues for duplicates

Bug Description

Again another episode of very slow loading time of Signal Desktop. It has been reported many times (e.g., #5774, #1842, #3171, #3010) that the Desktop app gets super slow for loading messages upon startup. Although this is a "duplicate" but I'm filing this bug report because we were told to do so:

I'm going to close this, since a few of you have confirmed performance improvements. We'd like people to enter new bugs once things get this big anyway.

So here it is:

Signal is my primary messaging platform, but during the past few days I didn't have a large traffic of message (inbound or outbound). I closed Signal Desktop two days ago, and I opened it this morning (so it was loading slightly more than one single day, but still it look relatively a long time to load only about 83 messages ( 4 pictures, 5 voices, 2 videos).

Steps to Reproduce

  1. open Signal Desktop,... and wait
  2. wait more
  3. open a bug report ;)

Actual Result:

Finally opened (check the debug log).

Expected Result:

Open practically instantly.

Screenshots

--not applicable--

Platform Info

Signal Version: 6.29.1

Operating System:

lsb_release -a
LSB Version:	n/a
Distributor ID:	ManjaroLinux
Description:	Manjaro Linux
Release:	23.0.1
Codename:	Uranos

Linked Device Version: Android 6.31.2

Link to Debug Log

Signal Desktop debuglog

@nils-werner
Copy link

I'm experiencing the same and I can hear that my harddrive is just grinding and grinding and grinding while Signal is trying to start. So maybe inefficient and/or excessive disk read/write behaviour?

@scottnonnenberg-signal
Copy link
Contributor

@nils-werner We can look into it if you provide a debug log!

@trevor-signal
Copy link
Contributor

@mmahmoudian From looking at your log, it seems that writes to our database are taking unusually long on your system. Can you think of anything about your setup that might contribute to slow writes, or anything that changed that coincides with you noticing the slow startup time? Low free disk space, perhaps?

@mmahmoudian
Copy link
Author

@trevor-signal

Can you think of anything about your setup that might contribute to slow writes, or anything that changed that coincides with you noticing the slow startup time? Low free disk space, perhaps?

I see the same issue across two computers, and the diskIO looks normal in both and I don't have any issue with other software. I also have about 100GB free on one device and about 250GB on the other one. The only commonality between there two computers are:

  1. me
  2. Manjaro Linux
  3. Signal Desktop

Not even the mouse or monitor brand is in common.

@scottnonnenberg-signal
Copy link
Contributor

@mmahmoudian Maybe it's time to talk about your hard disk hardware and drivers? Are they SSDs or spinning plates?

@mmahmoudian
Copy link
Author

mmahmoudian commented Oct 6, 2023

My /home is on HDD and the / on NVME. This is also a common pattern on both of these computers.

Update: Considering the next comment, I though I add a bit more information: The /home is on ext4 on HDD.

@nils-werner
Copy link

nils-werner commented Oct 9, 2023

On my machine it's especially slow on a machine that's managed by homed, which uses HDD(ext4(LUKS(btrfs(data)))). That's of course a "slow setup", but no other application is that slow.

@mmahmoudian
Copy link
Author

@scottnonnenberg-signal
Today I opened the Signal app after 5 days (according to the app itself), and it took a very long time.

https://debuglogs.org/desktop/6.32.0/a1458bb7829bcfd6f7138c6a79db80f5a056fb7c4ab76d90b9be98de5778df00.gz

Also it was using lots of diskIO during the loading, but also surprisingly after the UI was loaded and the UI was laggy:

image

Additionally, after the app was loaded, it started showing notifications from some days back!

These cannot be because of HDD, and even if it is, I'm surprised that Signal is the only software I have that is this slow and laggy.

Please let me know if you need any further information or details.

Cheers

@mmahmoudian
Copy link
Author

mmahmoudian commented Oct 19, 2023

@trevor-signal

is there any further info I need to provide? If not, would you please revert your change and remove the "Need Information" label and assign back the "Bug". I think this issue is neglected because of the label.

I'm still having this issue and even suffering from laggy behavior when the UI is fully loaded:

image

Thanks.

@ayumi-signal
Copy link
Contributor

@mmahmoudian Hi, sorry you're still experiencing this issue. It's possible that HDD is making things a bit slower.

Asking for clarification: About slow startup time -- is this only when reopening the device after a few days or longer? And, when you close the app and reopen it -- do you experience this slow startup once again?

Possible reasons for slowness: After a week of inactivity, reopening the app might be slow due to processing many messages and a migration. Wondering if, after those tasks finish and you restart the app, then it's still consistently slow on startup.

Regarding the laggy behavior after UI is loaded, that might be a separate issue as this one is for slow startup time. The I/O usage is interesting and I also wonder what CPU usage is like.

@mmahmoudian
Copy link
Author

mmahmoudian commented Oct 19, 2023

It's possible that HDD is making things a bit slower.

That's impossible because:

  1. Remember those days that everything was HDD? How this is different?
  2. Why none if the other apps (Browser, inkscape, media players, ...) work "normal"? Of course I'm not going to list my whole software suite, but I can tell you that everything works smoothly except Signal desktop.

Edit: well, it can be possible that it is due to HDD, but not because it is HDD, but rather some method signal uses internally that is horribly slow on HDD. On the same HDD and computer I also do tons of data wrangling tasks (tens of gigabytes) with R, Python and Perl and it have been snappy as usual. The difference between SSD and HDD for a small messaging app cannot be this drastic.

About slow startup time

I'm sure it can be gauged from both of the log files I provided

And, when you close the app and reopen it -- do you experience this slow startup once again?

I have not tried because usually even when sitting in the background it consumes so much IO that it bothers me and I should close it after about 20-ish minutes.

Possible reasons for slowness: After a week of inactivity, reopening the app might be slow due to processing many messages

It happens even after 2 days of inactivity, and ad I have stated above, the number of conversations were miniscule. Please scroll up and check out the stats I provided in the original post.

The I/O usage is interesting and I also wonder what CPU usage is like.

No significant CPU usage at any time point (during loading UI or after)

@scottnonnenberg-signal
Copy link
Contributor

The difference between SSD and HDD for a small messaging app cannot be this drastic.

It might just be. We use SQLCipher under the hood, and it might be making more writes to disk than your system is really ready to handle. It's not something that most apps use.

Another thing you should know is that the Signal Protocol requires a lot of state to be kept on each side, and all of it is updated with every decrypted or encrypted message. Not only that, but the design of our system, with no data stored on the server, requires a lot more behind-the-scenes messages sent and received by Signal client devices. These won't register as 'messages' to you, because they just update state. For example: send a message in a group, and every device that receives it will send an acknowledgement message back.

Either way, we'd really love to know more - perhaps you could track disk usage at a very detailed level on your machine then send that to us, or do some benchmarks runs comparing your NVME and HDD?

Copy link

stale bot commented Jan 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 17, 2024
@mmahmoudian
Copy link
Author

Definitely not stale.

@stale stale bot removed the stale label Jan 18, 2024
@gabrielkrell
Copy link

I have been experiencing this also, multi-minute startups on desktop (ubuntu) with an untrustworthy progress bar. Log. Is Signal making a sequential DB write+read for each event? Seems like the sort of thing that should be batched and/or done in memory.

Copy link

stale bot commented Jun 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 10, 2024
@mmahmoudian
Copy link
Author

Bump to remove the nonsense scale label.

To maintainers: Usage of Stale bot is rude and offensive. When a bug is marked as stale, it doesn't mean the bug is fixed, so it should not subsequently be closed! Please consider removing this nonsensical bot. Thank you!

@stale stale bot removed the stale label Jun 10, 2024
@indutny-signal
Copy link
Contributor

indutny-signal commented Jun 10, 2024

@mmahmoudian if this still happens to you - could you submit a fresh debug log next time you encounter it, please? Thanks!

@mmahmoudian
Copy link
Author

mmahmoudian commented Jun 10, 2024

@indutny-signal How about Signal Desktop devs address this issue as-is with all these log files available here? What is wrong with the existing logs?

If you want one more log, I will spare some time to post another one, but only in this thread. Afterall, multiple logs can show a commonality that leads to a fix.

If there is truly a willingness to fix something, then fix the existing issue instead of referring to future ones!

Also, please remove that label from this issue. I have provided everything you asked for.

@indutny-signal
Copy link
Contributor

@mmahmoudian I totally understand your frustration. I'm asking for fresh logs only because we made lots of different improvements from the time of original reports (and debuglogs). Clearly, these fixes have not yet been sufficient to address the slowness that you experience, but having these improvements in place it should now be easier to see in the debug log, what in particular slows down your Desktop instances.

Sorry for the inconvenience, and hope to find a way to help you!

@mmahmoudian
Copy link
Author

@indutny-signal @scottnonnenberg-signal
Here is a fresh log out of the oven from Signal Desktop 7.11.0:

https://debuglogs.org/desktop/7.11.0/91bf3ab74342ac30a2e966dd641d8adaddd86f35e5d0cc295564abee04342d44.gz

For the record, this is the third log I'm submitting in this issue, and 4th log in total in this issue.

Now, please remove the "Need Information" label. and get rid of this Stale bot. The issue exists on the latest version and is definitely not stale!

@indutny-signal
Copy link
Contributor

Thank you for the logs!

@george-tsiros
Copy link

For what it's worth, it takes 4 seconds to start, from warm (right after i've closed it), on an 5950x doing nothing else, with 64 GB holding 1 firefox tab (the window i am typing in) and a half-empty, 500GB samsung evo 960.
It takes another 1 second to go from the splash screen to the first chat tab.

Call me weird, but Visual Studio 2022 (with an installation size of 15 GB) takes 3 seconds to reach an idle empty environment.

And before you say 'electron', firefox (with 9 add-ons) takes about 1 second to start, without any quickstart/preloading.

It's not that I get satisfaction from restarting Signal - or any program - repeatedly, but it does feel off.

@mmahmoudian
Copy link
Author

mmahmoudian commented Jul 22, 2024

Today, only syncing weekend messages which were not that many.

Screenshot_20240722_121104

This is the new log for version "7.15.0 production"

https://debuglogs.org/desktop/7.15.0/43b0a366a9dfa415a99e7453f8a553f6e3c3ad43dacfa4bbc07701bb0a9cfb6c.gz

if I understand the log file format, today starts from line 29123 of the log file.

A quick calculations (following is in R) shows about 9 minutes loading time for only 3 days worth of messages:

library('lubridate')
start_time <- lubridate::as_datetime("2024-07-22T09:06:53.047Z")
end_time   <- lubridate::as_datetime("2024-07-22T09:15:39.741Z")
difftime(end_time, start_time)
Time difference of 8.778233 mins

@borisneubert
Copy link

I have the same issue here. Starting signal on KUbuntu 24.04 with a week worth of messages to catch up takes half an hour. Please find the debug log attached (send it to the cloud was rejected with error).
debuglog.zip

@trevor-signal
Copy link
Contributor

@borisneubert sorry to hear that. The logs suggest that nearly every SQLite database operation was taking a very long time on your machine; is there anything about your hardware or system that might contribute to that?

@borisneubert
Copy link

My home directory is on NFS with Gb LAN on a reasonably fast NAS. I experience no significant delays with any other software that accesses files in my home directory. I have been happily using the signal desktop app under the same setup for a long time and I think that the slow start occured first a few months ago.

Where is the SQLite DB on Linux, please? I could run some speed tests on NFS vs. a local NVMe.

@scottnonnenberg-signal
Copy link
Contributor

@borisneubert You should be able to find the database at ~/.config/Signal/sql

@mmahmoudian
Copy link
Author

mmahmoudian commented Oct 1, 2024

I have moved the ~/.config/Signal to a partition on SSD and symlinked it back, and that have drastically improved the loading time, which means the issue is not my/our setup and computers, but rather the Signal itself. The software clearly needs some heavy optimization. There are still many people with computers and laptops that use HDD and just because some hardware is faster than before, we should not ignore and forget the existing issues with the software.

I wish I was electron app developer and cryptography expert to assist with fixing this issue, but I'm not. All I can do is to raise the issue (obviously I'm not alone), provide the information devs asks (which I/we have done numerous times), wait (which the original post here was created 384 days ago). I hope there is enough motivation and understanding from devs to investigate the issue and solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

10 participants