How to Scale Ejabberd Server MAChine on Centos to Handle 200 K Connections

how to open ejabberd server to public

  1. Verify that connections really go through to the server.

    On an Internet-connected box use telnet, nc or a similar command to verify connecting to well-known ports of your server works. Do

    $ telnet 123.123.10.210 5222

    and then type in some gibberish and press Enter to send it—you should receive an XML stanza from your server telling you you've sent a malformed stream and indicating a stream closure (to exit telnet session, press Crl-] then enter q and hit Enter).

    If this command hangs and then times out or outright fails, you have a network connectivity problem.

    When you're checking it's really handy to have an instance of tcpdump running to see if clien't packets come in and replies come out:

    # tcpdump -n -i eth0 'tcp and (port 5222 or port 5269)'

    (substitute the name of your Internet-connected interface instead of eth0).

  2. You must have a proper DNS setup for your XMPP domain.

    That is, if your users have JIDs in example.domain.com, everyone on the Internet should be able to ask their DNS servers about how to contact users with JIDs in that domain using XMPP. This is done using SRV records. The DNS server(s) maintaining the example.domain.com must have two DNS records:

    • _xmpp-client._tcp.example.domain.com pointing to the host and port of the server accepting client connections (so they should be 123.123.10.210 and 5222).
    • _xmpp-server._tcp.example.domain.com pointing to the host and port of the server accepting server connections (so they should be 123.123.10.210 and 5269).

    More info here.

    Run

    $ host -t srv _xmpp-client._tcp.gmail.com
    $ host -t srv _xmpp-server._tcp.gmail.com

    to get some idea about how it should look like.

One more thing to be aware here is that if your server is in a DMZ (not directly connected to Internet but mediated by a NAT device) the firewall setup should be more involved. But before delving into this please check the connectivity as explained above.

What is the max number of users per room on ejabberd?

Ok, we tried to set max users per room to 5000 and that worked.

max_users: Number: This option defines at the service level, the
maximum number of users allowed per room. It can be lowered in each
room configuration but cannot be increased in individual room
configuration. The default value is 200.

It looks like, I misunderstood what the doc says: The limit max users per room is set globally. It can be only lowered per room (it can't be increased over the global maximum).

Note: we would expect the server to log an error or at least a warning, why value 10000 can't be set, but we couldn't find anything.

Installing exmpp on Centos

You can install exmpp in two ways. both will work

Installation via source

Download the source from the following Source_Link

cd /usr/local/src/

wget the source here.

tar -xvf file.tar.gz

cd exmpp*
autoreconf -i
./configure
make
make install

Installation complete.

Installation via git

git clone git://git.process-one.net/exmpp/mainline.git exmpp_mainline

cd exmpp_mainline
./configure
make
make install

Installation is complete.

There are few dependencies for the exmpp to get installed. Make sue that they are installed in the server.

  1. Erlang/OTP
  2. C compiler

    gcc

  3. XML parsing library

    LibXML2

    Expat



Related Topics



Leave a reply



Submit