esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.67k stars 428 forks source link

Huge rdbms load when using mod_privacy #4371

Open oybek opened 2 months ago

oybek commented 2 months ago

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

arcusfelis commented 2 months ago

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).