Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load test for SRI+MTFSM requests #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions map/load/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
<property name="test.client.clientAddress" value="1111112" />
<property name="test.client.serverAddress" value="9960639999" />

<property name="test.srimt.client.numOfDialogs" value="10000" />
<property name="test.srimt.client.concurrentDialog" value="128" />

<property name="test.sri.client.numOfDialogs" value="50000" />
<property name="test.sri.client.concurrentDialog" value="512" />
<property name="test.sri.client.channelType" value="tcp" />
<property name="test.sri.client.clientIp" value="127.0.0.1" />
<property name="test.sri.client.clientPort" value="10000" />
<property name="test.sri.client.serverIp" value="127.0.0.1" />
<property name="test.sri.client.serverPort" value="11000" />
<property name="test.sri.client.clientPc" value="123" />
<property name="test.sri.client.serverPc" value="321" />
<property name="test.sri.client.ni" value="2" />
<property name="test.sri.client.si" value="3" />
<property name="test.sri.client.ssn" value="8" />
<property name="test.sri.client.rc" value="0" />

<path id="project.class.path">
<pathelement location="${assemble.dir}/sctp-api.jar" />
<pathelement location="${assemble.dir}/sctp-impl.jar" />
Expand Down Expand Up @@ -200,6 +217,66 @@
<arg value="1" /> <!-- routing indicator -->
</java>
</target>
<target name="sriclient" description="run the Load Test SRIClient">
<echo message="${cp.property}" />
<delete dir="client" />
<mkdir dir="client" />
<java classname="${packageprefix}.SriClient" fork="true" maxmemory="2048m" classpathref="project.class.path" dir="client">
<jvmarg value="-Dlog.file.name=log4j-client.log"/>
<jvmarg value="-Xms2048m"/>
<jvmarg value="-Xmx2048m"/>
<jvmarg value="-Xmn128m"/>
<jvmarg value="-XX:PermSize=256m"/>
<jvmarg value="-XX:MaxPermSize=256m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<jvmarg value="-XX:+UseParallelOldGC"/>

<arg value="${test.sri.client.numOfDialogs}" /> <!-- number of Dialogs -->
<arg value="${test.sri.client.concurrentDialog}" /> <!-- Concurrent Dialogs -->
<arg value="${test.sri.client.channelType}" /> <!-- socket type -->
<arg value="${test.sri.client.clientIp}" /> <!-- Client IP -->
<arg value="${test.sri.client.clientPort}" /> <!-- Client Port -->
<arg value="${test.sri.client.serverIp}" /> <!-- Server Ip -->
<arg value="${test.sri.client.serverPort}" /> <!-- Server Port -->
<arg value="${test.sri.client.clientPc}" /> <!-- Client PC -->
<arg value="${test.sri.client.serverPc}" /> <!-- Server PC -->
<arg value="${test.sri.client.ni}" /> <!-- NI -->
<arg value="${test.sri.client.si}" /> <!-- SI -->
<arg value="${test.sri.client.ssn}" /> <!-- SSN -->
<arg value="${test.sri.client.rc}" /> <!-- RC -->
<arg value="16" /> <!-- deliveryTransferMessageThreadCount -->
</java>
</target>
<target name="sriwithmtclient" description="run the Load Test SRI+MTFsm client">
<echo message="${cp.property}" />
<delete dir="client" />
<mkdir dir="client" />
<java classname="${packageprefix}.SriWithMTFsmClient" fork="true" maxmemory="2048m" classpathref="project.class.path" dir="client">
<jvmarg value="-Dlog.file.name=log4j-client.log"/>
<jvmarg value="-Xms2048m"/>
<jvmarg value="-Xmx2048m"/>
<jvmarg value="-Xmn128m"/>
<jvmarg value="-XX:PermSize=256m"/>
<jvmarg value="-XX:MaxPermSize=256m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<jvmarg value="-XX:+UseParallelOldGC"/>

<arg value="${test.srimt.client.numOfDialogs}" /> <!-- number of Dialogs -->
<arg value="${test.srimt.client.concurrentDialog}" /> <!-- Concurrent Dialogs -->
<arg value="${test.sri.client.channelType}" /> <!-- socket type -->
<arg value="${test.sri.client.clientIp}" /> <!-- Client IP -->
<arg value="${test.sri.client.clientPort}" /> <!-- Client Port -->
<arg value="${test.sri.client.serverIp}" /> <!-- Server Ip -->
<arg value="${test.sri.client.serverPort}" /> <!-- Server Port -->
<arg value="${test.sri.client.clientPc}" /> <!-- Client PC -->
<arg value="${test.sri.client.serverPc}" /> <!-- Server PC -->
<arg value="${test.sri.client.ni}" /> <!-- NI -->
<arg value="${test.sri.client.si}" /> <!-- SI -->
<arg value="${test.sri.client.ssn}" /> <!-- SSN -->
<arg value="${test.sri.client.rc}" /> <!-- RC -->
<arg value="16" /> <!-- deliveryTransferMessageThreadCount -->
</java>
</target>

<!-- -->
<target name="clean" description="clean the logs">
Expand Down
124 changes: 63 additions & 61 deletions map/load/src/main/java/org/restcomm/protocols/ss7/map/load/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,25 @@
*/
public class Client extends TestHarness {

protected static final String ASP_NAME = "ASP1";
private static Logger logger = Logger.getLogger(Client.class);

// TCAP
private TCAPStack tcapStack;
protected TCAPStack tcapStack;

// MAP
private MAPStackImpl mapStack;
private MAPProvider mapProvider;
protected MAPStackImpl mapStack;
protected MAPProvider mapProvider;

// SCCP
private SccpStackImpl sccpStack;
protected SccpStackImpl sccpStack;
private SccpResource sccpResource;

// M3UA
private M3UAManagementImpl clientM3UAMgmt;
protected M3UAManagementImpl clientM3UAMgmt;

// SCTP
private NettySctpManagementImpl sctpManagement;
protected NettySctpManagementImpl sctpManagement;

// a ramp-up period is required for performance testing.
int endCount;
Expand All @@ -126,10 +127,19 @@ public class Client extends TestHarness {

private CsvWriter csvWriter;

protected void initializeStack(IpChannelType ipChannelType) throws Exception {

private void initializeStack(IpChannelType ipChannelType) throws Exception {
this.rateLimiterObj = RateLimiter.create(MAXCONCURRENTDIALOGS); // rate

initializeStackNoReport(ipChannelType);

this.csvWriter = new CsvWriter("map");
this.csvWriter.addCounter(CREATED_DIALOGS);
this.csvWriter.addCounter(SUCCESSFUL_DIALOGS);
this.csvWriter.addCounter(ERROR_DIALOGS);
this.csvWriter.start(TEST_START_DELAY, PRINT_WRITER_PERIOD);
}

protected void initializeStackNoReport(IpChannelType ipChannelType) throws Exception {
this.initSCTP(ipChannelType);

// Initialize M3UA first
Expand All @@ -146,13 +156,7 @@ protected void initializeStack(IpChannelType ipChannelType) throws Exception {

// FInally start ASP
// Set 5: Finally start ASP
this.clientM3UAMgmt.startAsp("ASP1");

this.csvWriter = new CsvWriter("map");
this.csvWriter.addCounter(CREATED_DIALOGS);
this.csvWriter.addCounter(SUCCESSFUL_DIALOGS);
this.csvWriter.addCounter(ERROR_DIALOGS);
this.csvWriter.start(TEST_START_DELAY, PRINT_WRITER_PERIOD);
this.clientM3UAMgmt.startAsp(ASP_NAME);
}

private void initSCTP(IpChannelType ipChannelType) throws Exception {
Expand All @@ -167,7 +171,7 @@ private void initSCTP(IpChannelType ipChannelType) throws Exception {
null);
}

private void initM3UA() throws Exception {
protected void initM3UA() throws Exception {
this.clientM3UAMgmt = new M3UAManagementImpl("Client", null, null);
this.clientM3UAMgmt.setTransportManagement(this.sctpManagement);
this.clientM3UAMgmt.setDeliveryMessageThreadCount(DELIVERY_TRANSFER_MESSAGE_THREAD_COUNT);
Expand Down Expand Up @@ -298,15 +302,55 @@ public void terminate() {
}

public static void main(String[] args) {
IpChannelType ipChannelType = collectClientArgs(args);

final Client client = new Client();
client.endCount = TestHarness.RAMP_UP_PERIOD;

try {
client.initializeStack(ipChannelType);

Thread.sleep(TestHarness.TEST_START_DELAY);

while (client.endCount < NDIALOGS) {
// while (client.nbConcurrentDialogs.intValue() >= MAXCONCURRENTDIALOGS) {

// logger.warn("Number of concurrent MAP dialog's = " +
// client.nbConcurrentDialogs.intValue()
// + " Waiting for max dialog count to go down!");

// synchronized (client) {
// try {
// client.wait();
// } catch (Exception ex) {
// }
// }
// }// end of while (client.nbConcurrentDialogs.intValue() >=
// MAXCONCURRENTDIALOGS)

if (client.endCount < 0) {
client.start = System.currentTimeMillis();
client.prev = client.start;
// logger.warn("StartTime = " + client.start);
}

client.initiateUSSD();
}

client.terminate();

} catch (Exception e) {
e.printStackTrace();
}
}

protected static IpChannelType collectClientArgs(String[] args) {
int noOfCalls = Integer.parseInt(args[0]);
int noOfConcurrentCalls = Integer.parseInt(args[1]);

IpChannelType ipChannelType = IpChannelType.SCTP;
if (args.length >= 3 && args[2].toLowerCase().equals("tcp")) {
ipChannelType = IpChannelType.TCP;
} else {
ipChannelType = IpChannelType.SCTP;
}

System.out.println("IpChannelType=" + ipChannelType);
Expand Down Expand Up @@ -401,56 +445,14 @@ public static void main(String[] args) {

System.out.println("ROUTING_INDICATOR=" + TestHarness.ROUTING_INDICATOR);

// logger.info("Number of calls to be completed = " + noOfCalls +
// " Number of concurrent calls to be maintained = " +
// noOfConcurrentCalls);

NDIALOGS = noOfCalls;

System.out.println("NDIALOGS=" + NDIALOGS);

MAXCONCURRENTDIALOGS = noOfConcurrentCalls;

System.out.println("MAXCONCURRENTDIALOGS=" + MAXCONCURRENTDIALOGS);

final Client client = new Client();
client.endCount = TestHarness.RAMP_UP_PERIOD;

try {
client.initializeStack(ipChannelType);

Thread.sleep(TestHarness.TEST_START_DELAY);

while (client.endCount < NDIALOGS) {
// while (client.nbConcurrentDialogs.intValue() >= MAXCONCURRENTDIALOGS) {

// logger.warn("Number of concurrent MAP dialog's = " +
// client.nbConcurrentDialogs.intValue()
// + " Waiting for max dialog count to go down!");

// synchronized (client) {
// try {
// client.wait();
// } catch (Exception ex) {
// }
// }
// }// end of while (client.nbConcurrentDialogs.intValue() >=
// MAXCONCURRENTDIALOGS)

if (client.endCount < 0) {
client.start = System.currentTimeMillis();
client.prev = client.start;
// logger.warn("StartTime = " + client.start);
}

client.initiateUSSD();
}

client.terminate();

} catch (Exception e) {
e.printStackTrace();
}
return ipChannelType;
}

/*
Expand Down
Loading