mysql - ejabberd mod_archive_odbc 性能

标签 mysql xmpp ejabberd

我正在使用 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/

相关文章:

MySQL 日期添加间隔作为列表

php - 通过将时间戳与当前时间戳进行比较来判断时间戳是否过期

php - 如何在分解字符串中按名字 (SQL) 排序

xmpp - 使用(a)Smack在XMPP中创建类似WhatsApp,BBM的组

javascript - 如何在 Ejabberd 中启用基于角色的用户聊天

linux - 如何在 CentOS 上扩展 ejabberd 服务器机器以处理 200 K 连接?

MySQL:M:N 表链接两个表

objective-c - 成员(member)无法在 muc room 中获取成员(member)列表

XMPP:如何向服务器请求用户联系人的存在状态?

erlang - Mnesia删除错误