How to load test Openfire with Clustering?

Need help in resolving the following issue (version 3.6.4)

C:\Program Files\Java\jre6\LoadTestScripts>startup.bat

C:\Program Files\Java\jre6\LoadTestScripts>java -classpath xpp.jar;. OpenfireClu
sterStressTest
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at OpenfireClusterStressTest.send(OpenfireClusterStressTest.java:401)
at OpenfireClusterStressTest.testMultipleLogin(OpenfireClusterStressTest
.java:133)
at OpenfireClusterStressTest.main(OpenfireClusterStressTest.java:46)

At root@hostname, I did

ulimit -n 110000

java -classpath xpp.jar:. OpenfireClusterStressTest

and got following error after 28000 clients connected successfully.

java.net.SocketException: Broken pipe

  •    at java.net.SocketOutputStream.socketWrite0(Native Method)*
    
  •    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)*
    
  •    at java.net.SocketOutputStream.write(SocketOutputStream.java:124)*
    
  •    at OpenfireClusterStressTest.send(OpenfireClusterStressTest.java:401)*
    
  •    at OpenfireClusterStressTest.testMultipleLogin(OpenfireClusterStressTest.java:133)*
    
  •    at OpenfireClusterStressTest.main(OpenfireClusterStressTest.java:46)*
    

In xml I have specified 60,000 users. Server config is Core i5, 4GB RAM, RHEL5 i686 (32 bit), ulimit -n 110000

Please suggest a workaround.

Hello every body.

I created 5000 user. Number of user per roster is 49.

In xml file, i use:

  • amount is 60000

  • startUser is 1

  • only one node is used to test

I run test program with command: java -classpath xpp.jar:. OpenfireClusterStressTest

Server configuration: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz; 16 core; 16GB ram

Openfire version is 3.7.0

Result: only about 800 user login. Cannot login with another account!

Test program has exception:

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:113)

at java.net.SocketInputStream.read(SocketInputStream.java:90)

at OpenfireClusterStressTest.read(OpenfireClusterStressTest.java:410)

at OpenfireClusterStressTest.access$300(OpenfireClusterStressTest.java:18)

at OpenfireClusterStressTest$2.run(OpenfireClusterStressTest.java:196)

java.net.SocketException: Too many open files

at java.net.Socket.createImpl(Socket.java:397)

at java.net.Socket.(Socket.java:371)

at java.net.Socket.(Socket.java:189)

at OpenfireClusterStressTest.testMultipleLogin(OpenfireClusterStressTest.java:111)

at OpenfireClusterStressTest.main(OpenfireClusterStressTest.java:46)

The server openfire has exception too:

2011.05.26 11:45:03 WARN org.apache.mina.common.support.DefaultExceptionMonitor.exceptionCaught(DefaultE xceptionMonitor.java:43) - Unexpected exception.

java.io.IOException: Too many open files

at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)

at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)

at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.processSessions(Sock etAcceptor.java:273)

at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.j ava:225)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:619)

This is content of clustertest.log file:

Thu May 26 10:13:48 ICT 2011- Packets Sent: 0

Thu May 26 10:13:48 ICT 2011- Users authenticated: 0

Thu May 26 10:14:02 ICT 2011- Packets Sent: 1000

Thu May 26 10:14:18 ICT 2011- Packets Sent: 2000

Thu May 26 10:14:33 ICT 2011- Packets Sent: 3000

Thu May 26 10:14:49 ICT 2011- Packets Sent: 4000

Thu May 26 10:15:05 ICT 2011- Packets Sent: 5000

Thu May 26 10:15:22 ICT 2011- Packets Sent: 6000

Thu May 26 10:15:38 ICT 2011- Packets Sent: 7000

Thu May 26 10:15:38 ICT 2011- Packets Sent: 7000

Thu May 26 10:15:57 ICT 2011- Packets Sent: 8000

Thu May 26 10:16:14 ICT 2011- Packets Sent: 9000

Thu May 26 10:16:32 ICT 2011- Packets Sent: 10000

Thu May 26 10:16:52 ICT 2011- Packets Sent: 11000

Thu May 26 10:17:17 ICT 2011- Packets Sent: 12000

Thu May 26 10:17:42 ICT 2011- Packets Sent: 13000

Thu May 26 10:18:04 ICT 2011- Packets Sent: 14000

Thu May 26 10:18:27 ICT 2011- Packets Sent: 15000

Thu May 26 10:18:51 ICT 2011- Packets Sent: 16000

Thu May 26 10:19:15 ICT 2011- Packets Sent: 17000

Thu May 26 10:20:54 ICT 2011- Packets Sent: 18000

Thu May 26 10:22:42 ICT 2011- Users authenticated: 1000

Thu May 26 10:23:35 ICT 2011- Packets Sent: 19000

Thu May 26 10:25:50 ICT 2011- Packets Sent: 20000

Thu May 26 10:26:01 ICT 2011- Packets Sent: 21000

Thu May 26 10:26:12 ICT 2011- Packets Sent: 22000

Thu May 26 10:26:46 ICT 2011- Packets Sent: 23000

Thu May 26 10:29:32 ICT 2011- Packets Sent: 24000

Thu May 26 10:31:48 ICT 2011- Packets Sent: 25000

Thu May 26 10:32:05 ICT 2011- Users authenticated: 2000

Thu May 26 10:32:16 ICT 2011- Packets Sent: 26000

Thu May 26 10:32:33 ICT 2011- Packets Sent: 27000

Thu May 26 10:32:49 ICT 2011- Packets Sent: 28000

Thu May 26 10:35:28 ICT 2011- Packets Sent: 29000

Thu May 26 10:37:52 ICT 2011- Packets Sent: 30000

Thu May 26 10:38:20 ICT 2011- Packets Sent: 31000

Thu May 26 10:38:27 ICT 2011- Users authenticated: 3000

Thu May 26 10:38:39 ICT 2011- Packets Sent: 32000

Thu May 26 10:38:56 ICT 2011- Packets Sent: 33000

Thu May 26 10:41:32 ICT 2011- Packets Sent: 34000

Thu May 26 10:44:08 ICT 2011- Packets Sent: 35000

Thu May 26 10:44:38 ICT 2011- Packets Sent: 36000

Thu May 26 10:44:44 ICT 2011- Users authenticated: 4000

That’s all.

Please tell my why.

Thanks and regarsd.

Hi,

The number of allowed open files in your OS need to be increased.

You will need to execute execute: ulimit -n unlimited or add these lines to the file /etc/security/limits.conf

  •            soft    nofile          906286
    
  •            hard    nofile          906286
    

More instructions.

Verify current settings executing: ulimit -Ha

1 Like

Thanks you very much.

I have been changed and server is easy to load 5000 concurent user.

I am doing load testing using Cluster Stress Test tool and only able to login from 4000 users .I get too many files error in openfire logs. I have set Ulimit (on Linux box ) and below is the result for the same. Do i need to do anything on openfire as well to read new limit of Ulimit. Linux box is rebooted as well.

Ulimit stats:

core file size (blocks, -c) unlimited

data seg size (kbytes, -d) unlimited

scheduling priority (-e) 0

file size (blocks, -f) unlimited

pending signals (-i) 56060

max locked memory (kbytes, -l) 64

max memory size (kbytes, -m) unlimited

open files (-n) 800000

pipe size (512 bytes, -p) 8

POSIX message queues (bytes, -q) 819200

real-time priority (-r) 0

stack size (kbytes, -s) unlimited

cpu time (seconds, -t) unlimited

max user processes (-u) 56060

virtual memory (kbytes, -v) unlimited

file locks (-x) unlimited

Openfire error:

java.io.FileNotFoundException: /opt/openfire/logs/stats.txt (Too many open files)

at java.io.FileOutputStream.open(Native Method)

at java.io.FileOutputStream.(FileOutputStream.java:221)

at java.io.FileWriter.(FileWriter.java:107)

at org.jivesoftware.openfire.plugin.StatCollector.run(StatCollector.java:115)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

2016.03.26 09:28:00 org.jivesoftware.util.Log - Error creating statistics log file

java.io.FileNotFoundException: /opt/openfire/logs/stats.txt (Too many open files)

at java.io.FileOutputStream.open(Native Method)

at java.io.FileOutputStream.(FileOutputStream.java:221)

at java.io.FileWriter.(FileWriter.java:107)

at org.jivesoftware.openfire.plugin.StatCollector.run(StatCollector.java:115)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

2016.03.26 09:29:05 org.jivesoftware.util.Log - Error creating statistics log file

java.io.FileNotFoundException: /opt/openfire/logs/stats.txt (Too many open files)

at java.io.FileOutputStream.open(Native Method)

at java.io.FileOutputStream.(FileOutputStream.java:221)

at java.io.FileWriter.(FileWriter.java:107)

at org.jivesoftware.openfire.plugin.StatCollector.run(StatCollector.java:115)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:61co re file size

at java.lang.Thread.run(Thread.java:745)

Clustering test error:

OpenfireClusterStressTest$5.run(OpenfireClusterStressTest.java:291)

java.net.SocketException: Connection reset

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)

at java.net.SocketOutputStream.write(SocketOutputStream.java:147)

at OpenfireClusterStressTest.send(OpenfireClusterStressTest.java:401)

at OpenfireClusterStressTest.changePresence(OpenfireClusterStressTest.java:306)

at OpenfireClusterStressTest.access$1000(OpenfireClusterStressTest.java:18)

at OpenfireClusterStressTest$4.run(OpenfireClusterStressTest.java:264)

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:135)

at java.net.SocketInputStream.read(SocketInputStream.java:122)

at java.net.SocketInputStream.read(SocketInputStream.java:108)

at OpenfireClusterStressTest.read(OpenfireClusterStressTest.java:410)

at OpenfireClusterStressTest.access$300(OpenfireClusterStressTest.java:18)

at OpenfireClusterStressTest$2.run(OpenfireClusterStressTest.java:196)

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:135)

at java.net.SocketInputStream.read(SocketInputStream.java:122)

at java.net.SocketInputStream.read(SocketInputStream.java:108)

at OpenfireClusterStressTest.read(OpenfireClusterStressTest.java:410)

at OpenfireClusterStressTest.access$300(OpenfireClusterStressTest.java:18)

at OpenfireClusterStressTest$2.run(OpenfireClusterStressTest.java:196)

java.net.SocketException: Connection reset

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)

at java.net.SocketOutputStream.write(SocketOutputStream.java:147)

at OpenfireClusterStressTest.keepAlive(OpenfireClusterStressTest.java:160)

at OpenfireClusterStressTest.access$100(OpenfireClusterStressTest.java:18)

Trying to perform load test on openfire but users are not connecting to openfire server.

Created 30000 users, the number of users per roster is 49.

In OpenfireClusterStressTest.xml config file set the parameters-

3000

userq

1

nchat

x.y.z.a

x.y.z.b

Openfire version is 4.1.1

Java version: 1.8, 64 bit VM

I run test program with command: java -classpath xpp.jar;. OpenfireClusterStressTest

It’s giving no exceptions.

Even verified in openfire error logs, no exceptions there.

Content of clustertest.log file,

Thu Jan 12 15:25:40 IST 2017- Packets Sent: 0

Thu Jan 12 15:25:40 IST 2017- Users authenticated: 0

Thu Jan 12 15:26:04 IST 2017- Packets Sent: 1000

Thu Jan 12 15:26:22 IST 2017- Packets Sent: 2000

Thu Jan 12 15:26:40 IST 2017- Packets Sent: 3000

Thu Jan 12 15:26:59 IST 2017- Packets Sent: 4000

Thu Jan 12 15:26:59 IST 2017- Packets Sent: 4001

Thu Jan 12 15:27:17 IST 2017- Packets Sent: 5000

Thu Jan 12 15:27:35 IST 2017- Packets Sent: 6000

Thu Jan 12 15:27:53 IST 2017- Packets Sent: 7000

Thu Jan 12 15:28:11 IST 2017- Packets Sent: 8000

Thu Jan 12 15:28:29 IST 2017- Packets Sent: 9000

Thu Jan 12 15:28:48 IST 2017- Packets Sent: 10000

Thu Jan 12 15:29:06 IST 2017- Packets Sent: 11000

Thu Jan 12 15:29:24 IST 2017- Packets Sent: 12000

Thu Jan 12 15:29:41 IST 2017- Packets Sent: 13000

Thu Jan 12 15:29:59 IST 2017- Packets Sent: 14000

Thu Jan 12 15:30:18 IST 2017- Packets Sent: 15000

Thu Jan 12 15:30:36 IST 2017- Packets Sent: 16000

If, I missed anything and did something wrong then please guide us.

Any help will be appreciated.

Thanks,

AKS

anybody can help the guy above me ??

I have openfire with agents configured through JDBCUserProvider by pointing to external database. So this provides inability to create user with the pattern specified by OpenfireClusterStressTest tool. Is there any option to customize this tool to fetch the user list from a text file and perform the same load test. Help here is appreciated.