powered by Jive Software

Openfire3.3.0 concurrent test error only 20 users?

hi

The openfire support 30K concurrent user connect to server and login at the same time?

but i wrote test java code with smack.jar,the result is 20 concurrent user just has error:

smack error:

javax.net.ssl.SSLException: Received fatal alert: internal_error

at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)

at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)

at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:11 21)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:327)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63)

my code:

package org.user.wf;

import org.jivesoftware.smack.ConnectionConfiguration;

import org.jivesoftware.smack.XMPPConnection;

public class ConcurrentTestServer {

public static void main(String[] args) {

int maxUser = 20;

String host = “ip”;

TestServerVirtualUser.host = host;

TimeCounter tc = new TimeCounter();

tc.testUserNumber = maxUser;

TestServerVirtualUser[] vuArray = new TestServerVirtualUser[maxUser];

for(int i=0;i<maxUser;i++)

vuArray[i] = new TestServerVirtualUser(i+1,tc);

tc.startTime = System.currentTimeMillis();

for(int i=0;i<maxUser;i++)

vuArray[i].start();

}
}

class TestServerVirtualUser extends Thread
{

public static Object lock = new Object();

public String userName;

public int userId;

public static String userPrefix = “user_”;

public static String host;

final public static int port = 5222;

private TimeCounter tc = null;

static public int waitTime = 1000*2;

public TestServerVirtualUser(int userId,TimeCounter tc)

{

super(“Thread [“userPrefixuserId+”]”);

this.userId = userId;

this.userName = userPrefix+this.userId;

this.tc = tc;

}

public void run()
{

userName = userPrefix + userId;

try

{

Thread.sleep(waitTime);

ConnectionConfiguration config = new ConnectionConfiguration(host, 5222);

config.setTLSEnabled(true);

config.setCompressionEnabled(false);

config.setSASLAuthenticationEnabled(true);

XMPPConnection conn = null;

conn = new XMPPConnection(config);

conn.login(userName, “111”, “ConcurrentTool”);

System.out.println(userName+" login");

tc.success();

Thread.sleep(1000*60);

}
catch(Exception ex)
{

ex.printStackTrace();

tc.fail();

}
}
}

class TimeCounter
{

int sucessed = 0;

int failed = 0;

long startTime = System.currentTimeMillis();

public int testUserNumber = 0;

synchronized public void success()

{

sucessed++;

if((failed+sucessed) == testUserNumber)

finish();

}

synchronized public void fail()
{

failed++;

if((failed+sucessed) == testUserNumber)

finish();

}

synchronized private void finish()
{

System.out.println(“finished”);

System.out.println(“successed:”+sucessed);

System.out.println(“failed:”+failed);

long time = (System.currentTimeMillis()-startTime)-TestServerVirtualUser.waitTime;

System.out.println("time?"time"m,“time/1000"s”);

}

}

Message was edited by: webjlwang