tigase / tigase-server

(M) Highly optimized, extremely modular and very flexible XMPP/Jabber server
https://tigase.net
GNU Affero General Public License v3.0
326 stars 106 forks source link

Activation of Offline Presence Plugin #180

Closed FelipeIregui closed 1 year ago

FelipeIregui commented 1 year ago

I have a problem with… Hi, Im having issues regarding the activation of the offline presence plugin, since when it is activated the consumption of server and db resources grows to the roof and may start failing other proceses. I think that this growth in consumption will stabilized in some point after few hours if we increase cache max entries. Is this correct? Do you have any other suggestions to minimized this growth? Thank You very much.

Details (please complete the following information):

woj-tek commented 1 year ago

Could you be more specific regarding "consumption of server and db resources grows to the roof and may start failing other proceses."

Do you mean CPU? Memory? Storage of the DB?

The plugin uses cache but it also relies on database to persist presence data. Number of DB requests could be significant in case of frequent reconnects (mobile OS without stream management for example).

FelipeIregui commented 1 year ago

What we are seeing exactly is an increase on RDS metrics regarding, delete throughput, insert latency, presence number and 85% con CPU. I see cache size is not that big but possibly this will happen for a few minutes and then the values will become stable again, maybe right?

woj-tek commented 1 year ago

OK, it seems that mostly RDS metrics are affected thus it would indicate higher number of queries which in turn would suggest that indeed increasing cache size (and thus reducing number of queries) should help.

If you are using RDS, do you have performance insights enabled and could share information from it? Which queries are the biggest offenders? I would assume TigUpdatePairs and select pval from tig_pairs…

FelipeIregui commented 1 year ago

Thank You! Would try and see what can be done. Actually yes, all regarding tig_pairs are very paintful buut we are also encountering issues with normal selects and counts to tig_users.