Signal-android: Signal gets really slow on long Conversations

Created on 17 Aug 2020  路  21Comments  路  Source: signalapp/Signal-Android


Bug description

If I have a long Chat with someone, probably multiple thousand Messages and Media in History, then the Chat gets REALLY slow. We talking about 40-50 sec for one Message to get send and it only gets slower. If you send multiple Messages after the first one, it can take up to multiple Minutes till they get send. Receiving Messages takes ~10-15 sec. Short Chats dont seem to be affected. Its the most brutal if the other Person is writing/answering at the same time as your Message sends. Signal gets really laggy, the phone gets hot and slow, till anything is sent. Not related to this, but maybe Interesting: Backups take around 3 hours to finish. Backupfile is around 7GB in Size.

Steps to reproduce

  • Open Signal
  • Go to Chat with long History (opening and closing that Chat is also really slow)
  • Send one or Multiple Messages

Actual result: Messages take sometimes Minutes to Send.
Expected result: Messages should be send almost instant, like in a fresh Chat.

Device info


Device: Galaxy S5 klte / SM-G900F
Android version: 9.0 LineageOS 16
Signal version: 4.68.8, persists in 4.69.6, persists in 4.70.3, persists in 4.70.5

Link to debug log

https://debuglogs.org/fff230b9173168bd607d678f019b51b7dc38c12ced3661f169c51e1968b147d8

EDIT: New Log, while sending and receiving Messages at the same time:

https://debuglogs.org/7eead199b7af5be480058d38b128f766cf4536beb0be0b4a24aa2ad962aada09

EDIT2: Now (28th Aug) the Problem is so bad, that the App gets nearly unusable. Messages take around 90 Seconds to get send. Only in that one, long Chat. As long as one Message in that Chat is sending, anything else is almost not responding and the App locks up sometimes. Even receiving Messages in that Chat is so slow, that sometimes the Person thinks i lost connection or turned off my Phone. Isnt there anything that can be done, without loosing all the History ? I used Whatsapp for some time before and had Chats with around 30-40k Messages and NEVER had any Problems like that, why is it, that Signal has such poor Performance ?

EDIT3 (4th Nov): Time to send one Message went up to ~130 secs. Pics dont always send. Just the Text under them. App is barely usable whenever i access a long Chat.

Probably Related

9881

Most helpful comment

@Anti-ctrl Doing investigations around performance and starting improvements is something I'm working on. I know as someone on the outside who is having a specific problem, it can be frustrating when you feel the team is prioritizing things that aren't your problem. And believe me when I say I understand that it's a bad problem. However, I assure you that there are many people with many different problems, and as a team we have to make hard decisions all the time about what we want to work on at that moment. I wanna fix this, it's just gonna take some work :+1:

All 21 comments

I originally planned my own Bug report for this, but I think it fits here really well. I hope a dev can help here and get behind this issue, because I think Signal really has a performance Problem on some devices.

I have a friend, that complains frequently about Signal being slow to send her messages. In a Group Chat it takes about 15 seconds for one message to send, sometimes up to one minute. Also media messages take a long time to download. Recieving messages is slow as well. When I send a message in the Group Chat with her, I notice that it takes several seconds until she receives the message, where other members receive them almost instantly. In one to one conversations it is a bit better, but still noticeable. She also tried it over mobile data and different WiFi networks, so it shouldn't be a network Problem on her end. Note: she has about 5 GB of stored Data in Signal.

Device: Nokia 6
Android Version: 9
Signal Version: 4.68.8

Debug Log: https://debuglogs.org/7838b66ab1607c0c8e9abaa93ec6b462cc1319dc5aa65f7d5effafb94c7ca8a7
Note: The Debug Log was captured after messaging in a group at first and then a few messages in a one to one chat.

I originally planned my own Bug report for this, but I think it fits here really well. I hope a dev can help here and get behind this issue, because I think Signal really has a performance Problem on some devices.

I have a friend, that complains frequently about Signal being slow to send her messages. In a Group Chat it takes about 15 seconds for one message to send, sometimes up to one minute. Also media messages take a long time to download. Recieving messages is slow as well. When I send a message in the Group Chat with her, I notice that it takes several seconds until she receives the message, where other members receive them almost instantly. In one to one conversations it is a bit better, but still noticeable. She also tried it over mobile data and different WiFi networks, so it shouldn't be a network Problem on her end. Note: she has about 5 GB of stored Data in Signal.

Device: Nokia 6
Android Version: 9
Signal Version: 4.68.8

Debug Log: https://debuglogs.org/7838b66ab1607c0c8e9abaa93ec6b462cc1319dc5aa65f7d5effafb94c7ca8a7
Note: The Debug Log was captured after messaging in a group at first and then a few messages in a one to one chat.

Great to see, that I麓m not alone. For a Messenger both phones should麓ve plenty of Power. I have a guess what it might be, even tho I麓m probably wrong with that. At least the Snapdragon 801 in my Phone doesnt support AES Encryption in Hardware. Couldnt find anything about the Snapdragon 430 in the Nokia 6. I know Signal Protocol uses ChaCha20 for Encryption, but doesnt that benefit from Hardware Encryption too?

It took me around 6 Month till i opened this Bugreport, because i thought it might get fixed in some Updates and in Fact, this is my first Bug Report ever, so i hope i do anything right.

My Log File was taken, after i sent a Message to a Contact, which i wasnt actively writing with, but where the Problem is the biggest.
I experience the same issues you are talking about, but yours is better explained. In my Group Chat it really helps, if i Delete all Media from the Chat. Messages still take a long time, but not as long. IDK I really hope someone can help with that, as I麓m a total noob in Programming or even Debugging.

This bug might be a duplicate of #9881. I have this same issue, but I don't get to 50 seconds, but up to 15 seconds on the following devices (and specific chats of course):

Huawei Honor 9
Huawei P40 Lite 5G
Xiaomi Mi A1
Samsung Galaxy S8

Sending lots of voice notes while the other is sending their own voice notes makes all this really terrible, messages lag behind and you have to wait for Signal to send them. At least 2 of these 4 devices have AES hardware acceleration, it might help to not arrive to 50 seconds but definitely the problem persists.

A friend of mine fixed this by setting a limit of 5000 messages per conversation, while I didn't. His chat is quick now, mine is not, since I did not apply the limit. With another friend of mine, we have been creating a group each month with only me and her inside, so the chat history never gets too long.

Signal needs this to be fixed as soon as possible. Please focus on this before adding new features, many users are not patient and are leaving.

Quick Update: I think since 4.69.6 my Backup time is drastically reduced. Takes ~25-35 Minutes to complete the Full 7-8GB Backup, instead of ~3 hours. My Battery says "thank you". The Rest of the Problems still persist and get worse every Day. Its now at a Point where you can really feel and see how much slower Signal gets with every extra day. I send Messages from my PC now, because on my Phone its anything but "Realtime". If that continuous i see myself forced to switch to something else, as it not only not pleasant, but annoying at this point.

I really hope someone can fix this, as I dont have the Skills todo it myself unfortunately.

I have one of these really long one-to-one conversations as well and it's getting worse. My main issue is that after pressing send, I have to leave Signal in the foreground for the ~13 seconds it currently takes to send a message in that particular chat or the message will never send. If I put Signal in the background while a message is still sending, it will remain in the 'pending' state indefinitely (I guess the send job takes too long and gets killed by the OS?). If I reply to multiple things in quick succession, this can easily mean having to wait 50-60 seconds before I can do anything else on my phone.

I have one of these really long one-to-one conversations as well and it's getting worse. My main issue is that after pressing send, I have to leave Signal in the foreground for the ~13 seconds it currently takes to send a message in that particular chat or the message will never send. If I put Signal in the background while a message is still sending, it will remain in the 'pending' state indefinitely (I guess the send job takes too long and gets killed by the OS?). If I reply to multiple things in quick succession, this can easily mean having to wait 50-60 seconds before I can do anything else on my phone.

Not as bad for me, at least on txt msg. Pictures need to "show up" before i can leave it on sending in the Background, but if i switch immediately to another app, i recognize the same behaivior, but not every time. My Problem is just, that it takes around 30 sec to send one message and if u add another one in the sending process it takes easily 90 seconds for ONE message to get send. Rest one will follow after that in 30 or so sec steps. Quickly adds up to minutes of just waiting and while my txt partner can write messages, he/she often gets confused because my answers, which are way too late, make no sense at all.

I also have the same problem as described by @haffenloher. Sometimes messages will not be sent at all if the app is put to the background too quickly after sending inside chats with a long message history (which also takes quite long if it works).

Debug log: https://debuglogs.org/c7581cd3e032893312d3b7a8ea3fa02dbb086ab265b07febd91a409d8d3922bf
The last time it happened around 2020-09-01 15:22:51

Thank you all for your debug logs and information. We are aware of the issue and unfortunately there isn't a quick fix we can just knock out for y'all. We're hoping to dedicate some serious time to performance improvements in the very near future. This probably isn't the news you wanted to read, but we hear you, we are aware of it, and we want to fix it, it's just going to take a little time on our end.

Thank you all for your debug logs and information. We are aware of the issue and unfortunately there isn't a quick fix we can just knock out for y'all. We're hoping to dedicate some serious time to performance improvements in the very near future. This probably isn't the news you wanted to read, but we hear you, we are aware of it, and we want to fix it, it's just going to take a little time on our end.

Thanks for your reply on that topic. I mean, its surely not what most of us wanna hear, thats right, but at least its something and we can hope that there might be a possible fix in the near future. I would guess, that most of us are patient enough to wait just a bit longer, even tho the experience is really unpleasant atm. Best of Luck for that Process and thanks for the Service :)

Thank you all for your debug logs and information. We are aware of the issue and unfortunately there isn't a quick fix we can just knock out for y'all. We're hoping to dedicate some serious time to performance improvements in the very near future. This probably isn't the news you wanted to read, but we hear you, we are aware of it, and we want to fix it, it's just going to take a little time on our end.

Is there any Update regarding that Topic ?
Performance is so bad that ppl are now pissed enough to just not use Signal anymore. Instead of providing useless new Features which slow down Signal even more, just fix that damn thing first. Even on a Pocophone F1, which isnt that slow, Signal just eats all Resources for a few seconds till messages are sent. In a really long Chat (90k Messages), that can take around 20-30 secs.
With my S5 I麓m now at over 2 Minutes for sending ONE freaking Message. Pictures also dont send every time. There is just the Text i provided with the Picture. Guys please. Finally do something!

@Anti-ctrl Hi there, I know you're frustrated, but unfortunately there aren't any simple remedies here. Improving performance in this area involves making some large fundamental changes, which takes time. New debuglogs are always useful though.

@Anti-ctrl Hi there, I know you're frustrated, but unfortunately there aren't any simple remedies here. Improving performance in this area involves making some large fundamental changes, which takes time. New debuglogs are always useful though.

I understand that it takes time, but has anyone even started to do anything about that poor performance, or are there still coming new features, before anything is done ? I will Edit this and Post another Debuglog as soon as i can. Thanks for the reply.

EDIT: Here is another Debuglog. Took it while chatting and waiting for sending on multiple messages in one Chat.
https://debuglogs.org/ca7016c395055c668da82c495a969a993dfba8f5d2d641d48d5bf1a5ea8df86d

Hope it helps somewhat.

@Anti-ctrl Doing investigations around performance and starting improvements is something I'm working on. I know as someone on the outside who is having a specific problem, it can be frustrating when you feel the team is prioritizing things that aren't your problem. And believe me when I say I understand that it's a bad problem. However, I assure you that there are many people with many different problems, and as a team we have to make hard decisions all the time about what we want to work on at that moment. I wanna fix this, it's just gonna take some work 馃憤

And yes its really annoying, sorry for my rant, its just really frustrating. Thanks for the effort, good luck fixing it. Will donate 1 or 10 coffee麓s next month to speed things up.

@Anti-ctrl Doing investigations around performance and starting improvements is something I'm working on. I know as someone on the outside who is having a specific problem, it can be frustrating when you feel the team is prioritizing things that aren't your problem. And believe me when I say I understand that it's a bad problem. However, I assure you that there are many people with many different problems, and as a team we have to make hard decisions all the time about what we want to work on at that moment. I wanna fix this, it's just gonna take some work :+1:

Unfortunately I am frustrated too about this issue, it's a total disaster. While using Signal and typing in some long chats and having to wait tens of seconds for messages to be sent in a 2020 smartphone, I really become willing to say some nice words here on this issue, but then I refrain :D

Anyway it seems you're using zetetic database, did you have a look at this page related to performance issues? https://discuss.zetetic.net/t/sqlcipher-performance-optimization/14

@greyson-signal

I know I'm just an user, but I strongly recommend you stop adding new features and pay more attention to the issues. They are more than 700 and are growing. This is a bad sign unfortunately. I know fixing bugs is absolutely not funny, but especially this one should have an upmost importance.
I have seen projects fail due to many features which introduced bugs, some projects became so buggy they have been abandoned. It's much more dangerous than what it might seem, unfortunately.

Anyway...

Do you have any idea about where the bottleneck might be?
I think, it's so slow it should be enough to just populate a database with lots of messages, trying to send one and then stopping the threads and reading the stack trace to see where they are statistically spending most of the time. It should be as easy as it seems to find the bottleneck. It's so slow that you shouldn't even need proper tools to find the bottleneck.

Where do Signal threads hang? Inside your code or inside zatetic db code?

This is happening to me too on a samsumg s9 with android 10. Just after a few days of conversation, the chat gets noticeably slower and the keyboard starts lagging, but not as bad as the OP. While I don't know much about the internals of the app, maybe you can only load the messages when the chat scrolls back? Instead of loading everything at once when the chat is opened. This sounds hard to do though.

@richardddd98 Believe me, if I could create these performance problems on any device I have access to, I would be working on them. They seem to crop up in specific situations that I can't reproduce. Or, they happen incredibly sporadically and then never again. As such, most of my efforts have gone into adding diagnostics. In terms of testing on devices with a lot of messages, my personal install is something like 10.5 GB.
I know that when an issue is happening to you, it's easy to assume it's happening to everybody. But to the best of my knowledge, it isn't. The most helpful thing you can provide is a debuglog.

@ASHuenchuleo

maybe you can only load the messages when the chat scrolls back?

Yep, we already do this.

@greyson-signal

(Using commit 40338afe7a5c10a6a57483dc5f46050a0d482af0)

I am not sure if I can help, but my Signal is also really slow (as you can see in the issues I opened).
I tried this:

  1. Find out in the profiler and log messages that signal spends ~2 seconds per batch message lookup in slow conversations and just <200ms in alright ones
  2. Debug Signal to get the secret database key
  3. Copy the database to my laptop
  4. Run the query on my laptop on the database (~30MB) and find out it still takes 1.8 seconds on a quite modern laptop:
    Execution completed without errors Result: 25 rows returned in 1825ms In line 1: SELECT _id, unique_row_id, BODY,
    With a where clause of
   LEFT OUTER JOIN part ON part.mid = mms._id
   WHERE (thread_id = 9)
   GROUP BY mms._id
   ORDER BY date_received DESC
   LIMIT 75,
         25)

The query in question was the queryTables in MmsSmsDatabase, called by getConversation in ConversationDataSource::loadInitial.

If I remove the ORDER BY date_received DESC it completes in ~45ms. It also no longer creates a temporary B-tree for the date ordering and changes some other stuff.
If I remove the GROUP BY mms._id (which has no effect on my query, but probably is there for a reason), it completes in ~300ms - and changes the query plan only slightly:

Existing query:

2   0   0   CO-ROUTINE 2
9   2   0   MERGE (UNION ALL)
11  9   0   LEFT
16  11  0   SEARCH TABLE sms USING INDEX sms_thread_date_index (thread_id=?)
77  9   0   RIGHT
88  77  0   SEARCH TABLE mms USING INDEX mms_thread_id_index (thread_id=?)
93  77  0   SEARCH TABLE part USING INDEX part_mms_id_index (mid=?)
220 77  0   USE TEMP B-TREE FOR DISTINCT
221 77  0   USE TEMP B-TREE FOR ORDER BY
301 0   0   SCAN SUBQUERY 2

Deleting the group by

2   0   0   CO-ROUTINE 2
9   2   0   MERGE (UNION ALL)
11  9   0   LEFT
16  11  0   SEARCH TABLE sms USING INDEX sms_thread_date_index (thread_id=?)
77  9   0   RIGHT
86  77  0   SEARCH TABLE mms USING INDEX mms_thread_date_index (thread_id=?)
91  77  0   SEARCH TABLE part USING INDEX part_mms_id_index (mid=?)
192 77  0   USE TEMP B-TREE FOR DISTINCT
222 0   0   SCAN SUBQUERY 2

As you can see it is now able to leverage the mms_thread_date_index for this query and no longer needs a temporary B-tree.

No idea if that should take that long or whether this post is helpful or just random noise, but maybe it serves as another data point.

Unfortunately I'm having the exactly same issues with long conversations. There's a nice delay 10-120 second delay.

I can message from my PC and it's instant...but on my Galaxy S10, there's this annoying delay.

@zyklon-b can you post a debug log from your phone? That could really help.

@greyson-signal I have another debug log for you: https://debuglogs.org/85dad199e51250243afdaf0bad07c9baac8ac456c60b52d5e6bcb593659e03cf

At first I sent many messages to a group that is slow for a member in the group. Then I sent more, while Signal was in the background for them.
And finally the member of the group sent about 20 messages.

Signal has been really slow for them, and we had to create a new group, because the old one became to slow. We don't want to create new groups every time there are too many messages in it. I hope this issue can be fixed eventually.

If we should test something and provide more debug logs we are happy to help.

Was this page helpful?
0 / 5 - 0 ratings