http-bind/BOSH very slow

Hi,

I made some tests to evaluate the posibilities to use XMPP from Javascript over BOSH. So I send packages from javascript to an external component and the component answers to this packages. When I tried this from two C#-Clients I can do 1000 roundtrips in about 2.5 seconds.
Now I tried this with BOSH and 1000 roundtrips take about 40 seconds. Looking at the ejabberd.log I can see that the time seems to be consumed in ejabberd. It's a bit strange, but the lag between

=INFO REPORT==== 2011-11-18 14:50:54.542 ===
D(<0.397.0>:ejabberd_sm:411) : session manager
        from {jid,"test","sms.localhost",[],"test","sms.localhost",[]}
        to {jid,"jadmin","localhost","PROTEL-JANTH","jadmin","localhost",
                "PROTEL-JANTH"}
        packet {xmlelement,"message",
                           [{"to","jadmin@localhost/PROTEL-JANTH"},
                            {"from",[...]},
                            {[...],...}],
                           [{xmlelement,[...],...}]}

=INFO REPORT==== 2011-11-18 14:50:54.543 ===
D(<0.397.0>:ejabberd_sm:510) : sending to process <0.386.0>

and

=INFO REPORT==== 2011-11-18 14:50:54.621 ===
D(<0.406.0>:ejabberd_http_bind:919) : OutPacket: [{xmlstreamelement,
                                                   {xmlelement,"message",
                                                    [{"from",
                                                      "test@sms.localhost"},
                                                     {"to",
                                                      "jadmin@localhost/PROTEL-JANTH"},
                                                     {"id",
                                                      "fce9fbea-234e-4d25-8ddf-27135db152bb"}],
                                                    [{xmlelement,"body",[],
                                                      [{xmlcdata,
                                                        <<"************...********">>}]}]}}]

seems to happen only on every seconds roundtrip. The next roundtrip looks normal - at least in the log file.

Any idea what can cause this?

Kind regards

I made some research and the

I made some research and the problem seems to be the following line in web/ejabberd_http_bind.erl.

-define(PROCESS_DELAY_DEFAULT, 10).

respectively this code block :

    Pdelay = case string:to_integer(xml:get_attr_s("process-delay",Attrs)) of
                 {error, _} ->
                     ?PROCESS_DELAY_DEFAULT;
                 {CPdelay, _} when
                       (?PROCESS_DELAY_MIN =< CPdelay) and
                       (CPdelay =< ?PROCESS_DELAY_MAX) ->
                     CPdelay;
                 {CPdelay, _} ->
                     lists:max([lists:min([CPdelay, ?PROCESS_DELAY_MAX]), ?PROCESS_DELAY_MIN])
             end,

As I'm not an erlang programmer. Is this code block correct? is it bad to set PROCESS_DELAY_DEFAULT to 0?

I've looked when and why was

I've looked when and why was that code included. It was included due to this ticket:
https://support.process-one.net/browse/EJAB-1257

Syndicate content