How to load test Openfire with Clustering?

Version 3

    Once you have installed Openfire Enterprise 3.4.0 and clustering is enabled you are ready to load test the server. Load testing a server means that we are going to simulate thousands of users connecting to the server and generating a lot of traffic to the server.

     

    The first step of a load test is to define the goals that you want to achieve. That means that you will need to know how many concurrent users you will have in your installation, the traffic that they will generate and the expected response time. More precisely, you have to figure out frequency users will change their presences, send messages, ask vCards or join rooms. Once you have defined your expected load and expected results you are ready for the next step which is Create User Accounts.

     

    To create user accounts you need to start Openfire in a single node, install the plugin and follow these steps:

    1. Log into the Admin Console and go to Users/Groups -> Users Creation

    2. Specify a User prefix for example "usr". In this example, the script will generate accounts of the form: usr0, usr1, usr2, usr3, etc.

    3. Specify the number of users to create and the amount of contacts in roster.

    4. Let the script run. The script will run in background and it will print in the stdout the progress of the user creation. Note that creating hundreds of thousands of users may take some hours.

     

    Finally, you need to setup the the load clients. Follow these steps:

    1. Define how many linux machines you are going to use. Note that each linux machine may simulate 60K concurrent users. If you are using many network interfaces it's possible to generate 60K per network interface. You might need to fine tune your linux box to be able to generate 60K connections.

    2. For each machine that will run the load test script you will need to:

      1. Create a folder and download , , , and . Unzip on your working directory

      2. Edit the OpenfireClusterStressTest.xml file

        1. Set amount of users to simulate. All load clients should use the same amount

        2. Set the user prefix to use. This value should match the one used in the userCreation plugin. In our example we used: "usr"

        3. Set startUser to define range of user accounts to use. For example if it is set to 100, the first user to login is usr100, then usr101 and so on. Make sure that each node is using a different range of accounts.

      3. cluster.node: Specify the IP address of hostname of each cluster node that is part of the cluster. Create a new node in the XML file for each cluster node

      4. Make sure that server matches the XMPP domain being used by Openfire. You can get this value from the main page in the admin console.

     

    Execution
    1. Startup the openfire cluster (this includes your cluster nodes)

    2. Run startup.bat for Windows or startup.sh for Linux in each load client

    3. The stress test progress can be seen in the file clustertest.log and also in the openfire console admin

    4. Once all users have logged in the stress test will continue generating traffic until you stop it. Hit any key to stop the load test script.

     

    Problems or questions should be posted to the discussion forums.