Search code examples
javaloadsmack

XMPP Load Test Using Smack Client API


I want to measure the XMPP Server capacity via performing a XMPP Load test. So I have implemented a Load Tester and used Smack Client API for connection handling.

But I have found out that it was so expensive because there are three threads (SmackExecutor, Reader and Writter) created per connection.

Therefore I cannot open more than 10K connection on a strong machine though increased machine OS limits such as file destrictor,..

Do you advice a tool or a implementing way to handle more than 20K connection at one machine.

]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 513395
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 524288
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 262144
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

enter image description here

[![enter image description here][2]][2]

Dependency:

<dependency>
    <groupId>org.igniterealtime.smack</groupId>
    <artifactId>smack</artifactId>
    <version>4.0.4</version>
</dependency>
<dependency>
    <groupId>org.igniterealtime.smack</groupId>
    <artifactId>smackx</artifactId>
    <version>4.0.4</version>
</dependency>
<dependency>
    <groupId>org.igniterealtime.smack</groupId>
    <artifactId>smack-debug</artifactId>
    <version>4.0.4</version>
</dependency>
<dependency>
    <groupId>org.igniterealtime.smack</groupId>
    <artifactId>smack-tcp</artifactId>
    <version>4.0.4</version>
</dependency>

Solution

  • There are several opinions about my question on the site https://discourse.igniterealtime.org/t/maximum-concurrent-users-possible-with-smack/72868/5

        Smack was not designed to create 10.000s of connections within 
    the same JVM (of course having multiple XMPPConnection within the same JVM is fine). 
    I would recommend using a more lightweight XMPP library written in C or in Lua for stress testing.
    
    
        You could also use multiple JVM processes, but still, the overhead caused by the threads 
    Smack uses per connection make it not the ideal library for stress testing.