David Chan | 1 Aug 2012 14:19
Picon
Favicon

Testing the load-balance capability of a clustered ejabberd configuration

Hi,
 
Would somebody help me on the following
I sent to the mailing list previously?
 
Thanks
 
 
 
-------------------------------------------------------------------------------
Hi,



I would like to build a set of ejabberd cluster servers,
but would like to know in advance on one thing:

      How can I make sure that the cluster is really load-balancing the incoming traffic?

I think the only way is to feed it with a large volume of requests/traffic,
so the question seems to lead to another:

     How to simulate a traffic-heavy environment for ejabberd?

From what I know there is a stress-testing tool called Tsung,
will it do the trick?

Thanks in advance

David
--------------
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Evgeniy Khramtsov | 1 Aug 2012 14:42
Picon
Gravatar

Re: Testing the load-balance capability of a clustered ejabberd configuration

On 01.08.2012 22:19, David Chan wrote:
> I would like to build a set of ejabberd cluster servers,
> but would like to know in advance on one thing:
>
>        How can I make sure that the cluster is really load-balancing the incoming traffic?

Add multiple A records to your DNS.

> I think the only way is to feed it with a large volume of requests/traffic,
> so the question seems to lead to another:
>
>       How to simulate a traffic-heavy environment for ejabberd?
>
>  From what I know there is a stress-testing tool called Tsung,
> will it do the trick?

Yes.

--

-- 
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram <at> jabber.ru.
Jorge Espada | 1 Aug 2012 14:52
Picon
Gravatar

Re: Testing the load-balance capability of a clustered ejabberd configuration

On Wed, Aug 1, 2012 at 9:42 AM, Evgeniy Khramtsov <xramtsov <at> gmail.com> wrote:
> On 01.08.2012 22:19, David Chan wrote:
>>
>> I would like to build a set of ejabberd cluster servers,
>> but would like to know in advance on one thing:
>>
>>        How can I make sure that the cluster is really load-balancing the
>> incoming traffic?
>
>
> Add multiple A records to your DNS.

Take a look here: http://blog.kolargol.eu/2012/05/haproxy-and-ejabberd.html

>
>> I think the only way is to feed it with a large volume of
>> requests/traffic,
>> so the question seems to lead to another:
>>
>>       How to simulate a traffic-heavy environment for ejabberd?
>>
>>  From what I know there is a stress-testing tool called Tsung,
>> will it do the trick?
>
>
> Yes.
+1
> --
> Regards,
> Evgeniy Khramtsov, ProcessOne.
> xmpp:xram <at> jabber.ru.
>
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
Hisham Mardam Bey | 7 Aug 2012 03:50
Picon
Gravatar

BOSH / IE7 hanging

Hi folks,

Our Ejabberd project uses the BOSH module coupled with StropheJS to
build a web based IM system. Everything is going great with the
exception of a little snag we hit. When we use Internet Explorer 7 to
hit the BOSH port on Ejabberd the browser spins and spins for a fair
amount of time (30 seconds or more) then finally gets its response.
This happens regardless of issuing a GET or  POST from IE7.

After some digging around I found out that its affected by the
returned HTTP headers. When I dumped the headers from a GET request to
the BOSH module I got:

  HTTP/1.0 200 OK
  Connection: keep-alive
  Content-Length: 502
  Content-Type: text/xml; charset=utf-8
  Access-Control-Allow-Origin: *
  Access-Control-Allow-Headers: Content-Type

I served those headers to IE7 via my web server and it stalled. To be
more precise, this is what I fed it:

  HTTP/1.1 200 OK
  Vary: Accept-Encoding
  Content-Length: 502
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/xml; charset=utf-8

I included the same data that is served by Ejabberd when a GET request
hits the BOSH (/http-bind/) path. When I changed those headers to the
following I got IE7 working again:

  HTTP/1.1 200 OK
  Date: Tue, 07 Aug 2012 00:43:55 GMT
  Server: Apache/2.2.20 (Ubuntu)
  X-Powered-By: PHP/5.3.6-13ubuntu3.8
  Vary: Accept-Encoding
  Content-Length: 502
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/html; charset=utf-8

The main difference is the "Content-Type" from "text/xml" to
"text/html". I then sent Ejabberd properly formatted POST requests to
initiate a BOSH session and I included "Accept" headers to try to get
it to send me "text/html" back but it did not respect that.

I also dug a bunch in the Erlang code, specifically
src/web/ejabberd_http.erl around:

-define(XHTML_DOCTYPE,
  "<?xml version='1.0'?>\n"
  ...

-define(HTML_DOCTYPE,
  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
  ...

and:

make_xhtml_output(State, Status, Headers, XHTML) ->
    Data = case lists:member(html, Headers) of
         true ->
       list_to_binary([?HTML_DOCTYPE,
           element_to_string(XHTML)]);
         _ ->
       list_to_binary([?XHTML_DOCTYPE,
           element_to_string(XHTML)])
     end,

after which I added the following:

    ?INFO_MSG("HEADERS=~p~nDATA=~p~n", [Headers, Data]),

So I can see the Headers and they turned out to be exactly what's in
?HEADERS defined in another hrl file.

The section above suggests that something can affect the outcome of
the headers, whether they're HTML_DOCTYPE or XHTML_DOCTYPE, and that
thing is the "html" atom that we're checking for in Headers. The
question I have is what gets that "html" into Headers? I've done a bit
more digging in the code but have not found my answer yet. Can anyone
help with this?

Also, I figured out that IE7 can't do XHTML properly as per
http://www.w3.org/MarkUp/2004/xhtml-faq#ie

Thanks all! (=

hmb.

--

-- 
Hisham Mardam-Bey
http://hisham.cc/
Hisham Mardam Bey | 7 Aug 2012 07:23
Picon
Gravatar

Re: BOSH / IE7 hanging

> The section above suggests that something can affect the outcome of
> the headers, whether they're HTML_DOCTYPE or XHTML_DOCTYPE, and that
> thing is the "html" atom that we're checking for in Headers. The
> question I have is what gets that "html" into Headers? I

A bit more clarification here.

The next bit of code goes on like this:

    Headers1 = case lists:keysearch("Content-Type", 1, Headers) of
       {value, _} ->
           [{"Content-Length", integer_to_list(size(Data))} |
      Headers];
       _ ->
           [{"Content-Type", "text/html; charset=utf-8"},
      {"Content-Length", integer_to_list(size(Data))} |
      Headers]
         end,

So if there's no Content-Type the code tries to use "text/html". The
main issue is that there's always a value coming form
src/web/http_bind.hrl:

-define(CT_XML, {"Content-Type", "text/xml; charset=utf-8"}).
...
-define(HEADER, [?CT_XML, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]).

Of course if I recompile Ejabberd with slight modifications to those
headers IE7 works.

Are there other options?

Thanks again,

hmb.

--

-- 
Hisham Mardam-Bey
http://hisham.cc/
sergio | 7 Aug 2012 12:56
Picon

display name in ldap shared roster

Hello.

Is it possible to show display name instead of nick in the ldap shared 
roster.
What setting affects this?

--

-- 
sergio.
christian.schreiber | 7 Aug 2012 13:05
Picon
Favicon

Re: display name in ldap shared roster

Hi,

you'll achieve this with "ldap_userdesc".

   {mod_shared_roster_ldap, [
                 {ldap_base, "ou=Users,dc=XXXXXXXX,dc=lan"},
                 {ldap_rfilter, 
"(&(objectClass=inetOrgPerson)(XXXXXX=TRUE))"},
               {ldap_filter, 
"(&(objectClass=inetOrgPerson)(XXXXXXX=TRUE))"},
               {ldap_gfilter, "(|(o=XXXXXX)(o=XXXXXX))"},
                 {ldap_memberattr, "uid"},
                 {ldap_userdesc, "cn"},
                 {ldap_auth_check, off},
                 {ldap_groupattr, "o"}
         ]},

Regards,
Christian

On 07.08.2012 12:56, sergio wrote:
> Hello.
>
> Is it possible to show display name instead of nick in the ldap
> shared roster.
> What setting affects this?
sergio | 7 Aug 2012 13:20
Picon

Re: display name in ldap shared roster

On 08/07/2012 03:05 PM, christian.schreiber <at> imessage.de wrote:

> you'll achieve this with "ldap_userdesc".
I've not wrote, but I've tried ldap_userdesc before the first letter.
I have {ldap_userdesc,"cn"} and cn is "FistName LastName" in my case.
But I still see nic in the roster.

May be ejabberd 2.1.5-3 doesn't support this?

--

-- 
sergio.
christian.schreiber | 7 Aug 2012 13:45
Picon
Favicon

Re: display name in ldap shared roster

Hi,

On 07.08.2012 13:20, sergio wrote:
> I've not wrote, but I've tried ldap_userdesc before the first letter.
> I have {ldap_userdesc,"cn"} and cn is "FistName LastName" in my case.
> But I still see nic in the roster.

I was running 2.1.10 with mod_shared_roster_ldap. Unfortunately it 
performed really bad. (2000 Users in 60 Groups)
So now I'm running mod_shared_roster_odbc (2.1.11) and run an importer 
nighly. I know, it's not best practice. But it works fine for me.
In with odbc I set the pretty Username whith "lusername" in table 
"vcard_saerch".

> May be ejabberd 2.1.5-3 doesn't support this?

I don't know what 2.1.5 supports and what it doesnt.

Christian
Alexander Zhebrak | 7 Aug 2012 17:26
Picon

Sending messages from external script

Hi there.

I have a daemon on Erlang that should send messages to the specific user (maybe to many users). How can I implement this?
We will have more than 100k users online.

Thanks for your help.

--
Alexander Zhebrak

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

Gmane