-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
delete_old_mam_messages causes spike in mnesia table size #1161
Comments
So it obviously didn't help to use transaction context for writing the I failed to reproduce the issue by transmitting a few messages while running the Either way, maybe we should just declare the Mnesia backend as unsupported for MAM. It's currently not usable in production, IMO. |
@weiss I think You need to transmitting a lot of messages not only few ;) For me problem doesn't exist anymore but I don't have on my server so many registered users as jabber.at. |
weiss, I think your previous commit improved the situation when there are many users with few messages, but it still breaks when a user has a lot of messages. Can you give this a try?
|
the most big issue i see here, despite the mam should use sql anyway, is that the mnesia table is disc_only and bag. this is very not suited for that. i'll provide a small patch to perform the cleanup in memory for better performances with mnesia. there are also maybe some possibles optimizations such as badlop's one. |
That's basically the way I did it initially (just without the write lock). It was way slower (it took hours instead of seconds/minutes), especially for the case where few users have many messages. Maybe each user's bag is rewritten on every Either way, I have no idea why the table is trashed. It does feel like an issue with |
I suggest this change to perform the cleanup in memory, then get the bag back to disc_only for normal operation. |
The situation may well be different now that we're deleting old messages in memory, of course. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
16.04
Debian 8
jabber.at Packages, which already includes some patches from @weiss (see
debian/patches/mod_mam*
in https://github.com/jabber-at/ejabberd/tree/master/debian/patches).We have enabled mod_mam and have a cron-jobs deleting old messages:
When starting with a fresh mod_mam table, soon after 21 days have past (23 this time),
delete_old_mam_messages chat
triggers a surge in the table size. The table increases in size from ~120 MB to 2 GB (mnesias table limit) before even the groupchat command executes.. This has happened a few times to us already, it not only breaks MAM, it also brakesejabberdctl dump
, thus disabling our backups.It seems to me @beherit describes similar issues in #1065.
The text was updated successfully, but these errors were encountered: