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

Performance question - retrieving and sending messages takes ~20 seconds #351

Closed
ghost opened this issue Sep 17, 2020 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Sep 17, 2020

First things first: I use this signal-cli inside a Python program via the subprocess module. However, executing the retrieve (signal-cli -u <sender> receive [--json]) command in a bash terminal still takes ~20 seconds to complete. Can anyone explain why this is taking so long?

@exquo
Copy link
Contributor

exquo commented Sep 18, 2020

Two common causes for signal-cli's long response times are: a long java virtual machine startup time, and the lack of cryptographic entropy. To avoid the JVM startup time, run signal-cli as a daemon and use dbus to interact with it; see https://github.com/AsamK/signal-cli/wiki/DBus-service. To increase system entropy, packages like haveged can help; see #101, #108, #131.

I don't know if receive requires any entropy, so it's probably all JVM startup time in your case. What hardware are you using, out of curiosity?

@ghost
Copy link
Author

ghost commented Sep 18, 2020

Running signal-cli as a daemon is a good idea - thanks for that! I'll try it later today and will report back wrt. performance.

My program mainly runs on a Raspberry (3), although it also takes about the same time on my Thinkpad T14. Just for your information, it's a cool little project I'm working on, basically I create a little assistant for me. I can (1) schedule messages, which are delivered at a certain time to a certain person (mainly used as reminder for myself), (2) keep track of my sport habits, (3) regularly (i.e. every few hours) check if certain websites (blogs and forums I follow, or for example, this very thread to be notified as soon as there is a comment) have changed, and if so I'll receive a signal message. In case anyone is interested in this project, please tell me, I'll be more than happy to provide the source code (I may even publish my git repo with a GPL license).

@ghost
Copy link
Author

ghost commented Sep 22, 2020

After using DBUS, I can now receive messages near-instantaneous (<2 sec). Thank you very much for your help!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant