MongooseIM icon indicating copy to clipboard operation
MongooseIM copied to clipboard

Huge rdbms load when using mod_privacy

Open oybek opened this issue 1 year ago • 1 comments

MongooseIM version: 6.2 Installed from: source Erlang/OTP version: 26

If we use

[modules.mod_privacy]
    backend = "rdbms"

for each send stanza, mongooseim goes into rdbms to fetch privacy list causing a huge load into rdbms

oybek avatar Sep 06 '24 08:09 oybek

Hi, @oybek It is a bit by design. We need to do privacy check, in the current XEPs.

ejabberd actually does not do privacy check for offline users, just writes messages in mod_offline and when a user returns, they read offline storage, read privacy list once and archive privacy-passed messages. So, here you do not need to run a privacy check, profit! Except if you use push notifications, you still have to. Or if you read archive though HTTP interface, without XMPP login...

You can write a module to cache privacy list in redis though, it likes that type of load. I also don't like current way of MAM working, we should just allow a user to send message to a conversation in archive, but not notify receiver, if he blocks the sender... Like many other messages do... So, we need a mute checker (oh, and we still need to do the check, before potentially pushing messages though push notifications).

arcusfelis avatar Sep 09 '24 06:09 arcusfelis