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

Take abou half minute doing hundries "peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id" ..." when send a simple message. #176

Open
SuperdukeGates opened this issue May 7, 2024 · 6 comments

Comments

@SuperdukeGates
Copy link

I have a matrix synapse server 1.106.0 and this server is private only without federation.

I managed to use matrix-commander (7.6.1 2024-05-02) to send messages to an encrypted DM room. But the matrix-commander takes about half minute to complete.

The command I use is

matrix-commander --sync OFF --log-level DEBUG DEBUG --message "Good Day :)"

The option --log-level DEBUG DEBUG is for debug only and then I got hundries peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id"... logs. And these took about 30 seconds.

2024-05-07 19:16:09,325:    DEBUG: matrix-commander: Log level is set for module matrix-commander. log_level=DEBUG
2024-05-07 19:16:09,325:    DEBUG: matrix-commander: Log level is set for modules below matrix-commander. log_level=DEBUG
...
2024-05-07 19:16:09,333:    DEBUG:           peewee: ('CREATE TABLE IF NOT EXISTS "storeversion" ("id" INTEGER NOT NULL PRIMARY KEY, "version" INTEGER NOT NULL)', [])
...
2024-05-07 19:16:09,437:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id" FROM "forwardedchains" AS "t1" WHERE ("t1"."session_id" = ?)', ['c2comCGfhqgeTX/eJuhs=======sTEcS7E4GHE8K2yk'])
(repeat hundries with different tail base64 text)
2024-05-07 19:16:36,352:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id" FROM "forwardedchains" AS "t1" WHERE ("t1"."session_id" = ?)', ['9LlsmEmQbelAAkvpPB=======YsqIFzr3JSWu3eDNsw'])
2024-05-07 19:16:36,374:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."account", "t1"."user_id", "t1"."device_id", "t1"."shared" FROM "accounts" AS "t1" WHERE (("t1"."user_id" = ?) AND ("t1"."device_id" = ?)) LIMIT ? OFFSET ?', ['@SOMEONE:SERVER', 'NT=======A', 1, 0])
2024-05-07 19:16:36,376:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."device_id", "t1"."user_id", "t1"."display_name", "t1"."deleted", "t1"."account_id" FROM "devicekeys" AS "t1" WHERE ("t1"."account_id" = ?)', [1])
2024-05-07 19:16:36,378:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."key_type", "t1"."key", "t1"."device_id" FROM "keys" AS "t1" WHERE ("t1"."device_id" = ?)', [1])
...
2024-05-07 19:16:36,771:    DEBUG:           peewee: ('SELECT "t1"."id", "t1"."key_type", "t1"."key", "t1"."device_id" FROM "keys" AS "t1" WHERE ("t1"."device_id" = ?)', [206])
...

How can I avoid this problem ?

@SuperdukeGates SuperdukeGates changed the title Take abou half minite doing hundries "peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id" ..." when send a simple message. Take abou half minute doing hundries "peewee: ('SELECT "t1"."id", "t1"."sender_key", "t1"."session_id" ..." when send a simple message. May 7, 2024
@sebix
Copy link

sebix commented May 24, 2024

We have the same issues and it takes more than 5 minutes now. The database has 50MB now. --logout ALL does not reduce the sessions either (as the help also states).

Solved by removing the store & the credentials and then logging in again.

@SuperdukeGates
Copy link
Author

Solved by removing the store & the credentials and then logging in again.

The room in my case is a DM room. What I resolve this is leave the room to abandon the DM room, then create/join to a new DM room. But this way I have no history messages. :(

@53c70r
Copy link

53c70r commented Aug 16, 2024

Like mentioned in #180 try to hold it open and feed it with stdin instead of clearing all the crypto from mem, just leave it there and feed the open program with your messages.

@sebix
Copy link

sebix commented Aug 17, 2024

Like mentioned in #180 try to hold it open and feed it with stdin instead of clearing all the crypto from mem, just leave it there and feed the open program with your messages.

Reducing the number of applications starts is a neat trick and may work in some cases, but not in others. Even if you keep the program open for longer, after some time you'll run into the same issue again, as the store will still grow, just slower.

@8go
Copy link
Owner

8go commented Sep 3, 2024

In some cases --sync OFF might help.

@8go
Copy link
Owner

8go commented Sep 3, 2024

For those who have flexibility, you might try the Rust version of matrix-commander, it is called matrix-commander-rs. It has fewer features but send might be faster. Try it.

See https://github.com/8go/matrix-commander-rs

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

4 participants