gpt4 book ai didi

mysql - ejabberd mod_archive_odbc 性能

转载 作者:行者123 更新时间:2023-11-29 03:05:19 25 4
gpt4 key购买 nike

我正在使用 ejabberd 2.1.12,为 mysql 数据库配置了 mod_archive_odbc。我在保存单个消息时检查了日志,它们看起来很可怕。 Ejabberd 假设是高度可扩展的 xmpp 服务器,但启用此模块后,mysql 数据库可能会成为瓶颈。

日志:

7 Query begin
7 Query select * from archive_global_prefs where us = '6@my.server'
7 Query select * from archive_jid_prefs where us = '6@my.server' and with_user = '4' and with_server = 'my.server' and with_resource = ''
7 Query select * from archive_jid_prefs where us = '6@my.server' and with_user = '4' and with_server = 'my.server' and with_resource = ''
7 Query select * from archive_jid_prefs where us = '6@my.server' and with_user = '' and with_server = 'my.server' and with_resource = ''
7 Query commit
5 Query begin
5 Query update archive_collections set with_resource = '', change_by = '6@my.server/my-resource', change_utc = '2013-05-11 09:47:46', subject = '', thread = '' where id = 9
5 Query insert into archive_messages(coll_id, utc, dir, name, body) values(9, '2013-05-11 09:47:46', 1, '', 'some random message')
5 Query commit
5 Query begin
5 Query select * from archive_global_prefs where us = '4@my.server'
5 Query select * from archive_jid_prefs where us = '4@my.server' and with_user = '6' and with_server = 'my.server' and with_resource = 'my-resource'
5 Query select * from archive_jid_prefs where us = '4@my.server' and with_user = '6' and with_server = 'my.server' and with_resource = ''
5 Query select * from archive_jid_prefs where us = '4@my.server' and with_user = '' and with_server = 'my.server' and with_resource = ''
5 Query commit
3 Query begin
3 Query update archive_collections set with_resource = 'my-resource', change_by = '4@my.server', change_utc = '2013-05-11 09:47:46', subject = '', thread = '' where id = 10
3 Query insert into archive_messages(coll_id, utc, dir, name, body) values(10, '2013-05-11 09:47:46', 0, '', 'some random message')
3 Query commit

这为每条消息提供了 8 次选择、2 次更新和 2 次插入。我调查了plugin's code发现有multiple insert implementation ,但这仅适用于手动归档。

有什么办法可以优化吗?

最佳答案

Erlang VM 具有高度可扩展性和可靠性。 eJabberd 不是。

不要害怕修改 mod 存档。您还可以查看优化 ejabberd odbc 模块,它们执行太多事务。

关于mysql - ejabberd mod_archive_odbc 性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16506067/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com