[ejabberd] Message sending perfomance

CGS cgsmcmlxxv at gmail.com
Thu Oct 6 10:41:54 MSD 2011


Hi,

Everything goes with a queue, it depends how fast the queue is emptied. One
option is to increase the allowed volume of the messages (bits/second).
Another option is to create spawn not-linked threads to send your message
via exmpp.

Cheers,
CGS



On Thu, Oct 6, 2011 at 8:37 AM, Alexander Kuleshov
<kuleshovmail at gmail.com>wrote:

> Hello,
>
> I have bot written with exmpp-0.9.5 and running in ejabberd.
>
> I need to send message from my bot to several people at once.
>
> I use:
>
> exmpp_session:send_packet(MySession, create_message(UserNick, MyMessage,
> Host)).
>
> where
>
> create_message/2 message packing to xml:
>
> create_message(To, Message, Host) ->
>    #xmlel{name=message, attrs=[#xmlattr{name= <<"to">>, value=
> list_to_binary(To ++ "@" ++ Host)}, #xmlattr{name = <<"type">>,
> value=list_to_binary("chat")}],
>    children=[#xmlel{name="body",
> children=[#xmlcdata{cdata=list_to_binary(Message)}]}]}.
>
> Message are sending, but i have a problem, when i try to send 1 message
> simultaneously to 8 - 9 players it's very slow. People get the message on
> the queue. Are there any methods of sending messages or maybe I send not
> right way?
>
> Thank you.
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20111006/120b895e/attachment.html>


More information about the ejabberd mailing list