Benchmarking Jabber/XMPP Servers with Jabsimul

strict warning: Only variables should be passed by reference in /opt/www/badlop/modules/book/book.module on line 559.

Important: some of the test results shown here are quite old. All the software benchmarked on them has improved, so you are encouraged to run the tests yourself with current versions of the software. At least until we update them.

System Setup

  1. Linux

    If you are going to simulate 2.000 concurrent users using the same machine as stress tool and stressed host, you have to setup limit to more than 4.000. For example:

    ulimit -n 16000

    Or you can edit the limit in /etc/security/limits.conf

    Another useful tip in some cases is to force linux to reuse stucked connections:

    echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
    echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

  2. Jabber/XMPP Server

    • jabberd 1.4

      Increase rate limitations in jabber.xml.

    • jabberd2

      Increase max_fds limitation in c2s.xml.

    • ejabberd

      Increase the traffic limit speed for normal connections in your ejabberd.cfg:

      {shaper, normal, {maxrate, 10000000}}.

      In order to register a lot of accounts fast, add this option to your ejabberd.cfg:

      {registration_timeout, infinity}.

      Increase Erlang ports limit, ETS maximum tables, and maximum processes. This can be configured in ejabberdctl.cfg or providing the arguments when starting erl:

      erl ... -env ERL_MAX_PORTS=5000 -env ERL_MAX_ETS_TABLES 20000 +P 250000 -shared
  3. Create users with Jabber Test Suite

    cvs -z3 -d:pserver:anonymous@jabbertest.cvs.sourceforge.net:/cvsroot/jabbertest co testsuite
    cd testsuite/
    cp Makefile.linux Makefile
    make userreg

    And now create 3000 users with username 'test_*' and password 'password' on your server 'localhost':

    ./userreg -h localhost -u 3000 -n 1
  4. Jabsimul

    Get Jabsimul from source package (also available a jab_simul Git repository):

    wget http://www.ejabberd.im/files/other/jabsimul.tar.gz
    tar xzf jabsimul.tar.gz
    cd jabsimul/jab_simul/
    cp jab_simul.xml.example jab_simul.xml

    Compile it:

    ./configure
    make

    Configure the tool:

    • user_names_generator
      • range: range of users that will login/logout
      • server: your server name
    • connect: how often a login is done
    • add_roster: add a contact to the user roster every 'frequency' until 'max_roster_count' is reached
    • del_roster: removes a contact from the roster
    • send_message: send a message
      • range: users that will receive messages
      • Xfile: file with the content of the message
      • If you use ejabberd 2.1.0 or newer, you must remove 'prepend_with_debug_info' because it makes jab_simul to be non compliant with XMPP: it sends messages with attribute from=bare JID, which is not the real full JID and ejabberd kicks the client session.
    • change_status
    • logout
    • kill_connection: connection is aborted
    • send_raw_bytes: sends random bytes (noise)

    Now you can execute it:

    ./jab_simul

Profiles

  • Users chatting

    jabsimul.xml.chat60

    • connect frequency: 30000 ms
    • add_roster frequency: 600000 ms
    • add_roster max_roster_count: 200
    • del_roster frequency: 600000 ms
    • send_message frequency: 60000 ms
    • message content: 'I'm sending you a message now, blablabla, blablabl blablaaa'
    • change_status frequency: 60000 ms
    • logout frequency: 300000 ms
    • kill_connection frequency: 120000 ms
    • send_raw_bytes frequency: 300000 ms

Tests

  • Test 1

    • System

      • Hardware: Toshiba Satellite A40-241. Mobile Intel Pentium 4 2.80 GHz, 256 MB RAM, 5537.79 Bogomips (cat /proc/cpuinfo).
      • Operating System: Debian GNU/Linux sid (with KDE 3.3 running while testing)
      • Kernel: Linux 2.6.7-1-686, official package in Debian
      • jabberd 1.4.3, official Debian package
      • jabberd2 2.0s2 unofficial Debian package, usgin MySQL storage
      • ejabberd 0.7.5 compiled from sources
      • Erlang R10B-1 compiled from sources
      • Jabsimul profile: Users chatting (jabsimul.xml.chat60)
    • Results

      Num users 500 1000 1500 2000 2500
      Server j1 j2 ej j1 j2 ej j1 j2 ej j1 j2 ej j1 j2 ej
      Latency (ms) 41 45 16 91 90 40 (1) 40 40 230
      CPU (%) 65 6 4 87 15 10 18 20 24 36
      Memory RES (MB) 10 36 41 17 93 60 122 70 80 90
      Memory VIRT (MB) 66 94 110 120 160

      (1) System started to swap to disk and latency was quite irregular, usually several seconds.

  • Test 2

    • System

      • Hardware: AMD Athlon(tm) XP 1700+, 768 MB RAM, 2908.16 Bogomips (cat /proc/cpuinfo).
      • Operating System: Debian GNU/Linux sid (in text mode)
      • Kernel: Linux 2.6.7-1-686, official package in Debian
      • ejabberd 0.7.5 compiled from sources
      • Erlang R9C-2 official Debian package
      • Jabsimul profile: Users chatting (jabsimul.xml.chat60)
    • Results

      Num users 1000 1500
      Server ej ej
      Latency (ms) 16 18
      CPU (%) 17 28
      Memory (MB) 62 87
  • Test 3

    • System

      • Hardware: AMD Athlon(tm) XP 1700+, 768 MB RAM, 2908.16 Bogomips (cat /proc/cpuinfo).
      • Operating System: Debian GNU/Linux sid (in text mode)
      • Kernel: Linux 2.6.11-1-386, official package in Debian
      • ejabberd 0.9.8 compiled from sources
      • Erlang R10B-7 compiled from sources + Kernel Poll patch
      • Jabsimul profile: Users chatting (jabsimul.xml.chat60)
    • Results

      Num users 1500 3000
      Kernel Poll no yes no yes
      Latency (ms) 16 16 28 28
      CPU (%) 15 2 30 4
      Memory RES (MB) 84 84 150 150
      Memory VIRT (MB) 94 94 160 160

Related Links

Syndicate content