some questions

85 views
Skip to first unread message

zhaolon...@gmail.com

unread,
Nov 20, 2008, 1:59:33 AM11/20/08
to jsmpp
hi, uudashr
I found jsmpp by chance yesterday , and I am interest in it.

1) I use StressClient.java send message to StressServer,
set DEFAULT_BULK_SIZE = 100000000

ntt2@ntt227:~/zlb_test/stress> sh runClient.sh
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Target server 10.0.5.226:8056
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
System ID: j
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Password: jpwd
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Source address: 1616
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Destination address: 62161616
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Transaction timer: 2000
2008-11-20 21:53:50,464 [main] INFO org.jsmpp.examples.StressClient -
Bulk size: 100000000
2008-11-20 21:53:50,466 [main] INFO org.jsmpp.examples.StressClient -
Max outstanding: 10
2008-11-20 21:53:50,467 [main] INFO org.jsmpp.examples.StressClient -
Processor degree: 3
2008-11-20 21:53:50,539 [main] INFO org.jsmpp.session.SMPPSession -
Connected
2008-11-20 21:53:50,540 [Thread-0] INFO org.jsmpp.session.SMPPSession
- Starting PDUReaderWorker with processor degree:3 ...
2008-11-20 21:53:50,552 [Thread-1] INFO org.jsmpp.session.SMPPSession
- Starting EnquireLinkSender
2008-11-20 21:53:50,552 [main] INFO org.jsmpp.examples.StressClient -
Bound to 10.0.5.226:8056
2008-11-20 21:53:50,553 [Thread-2] INFO
org.jsmpp.examples.StressClient - Starting traffic watcher...
2008-11-20 21:53:50,553 [main] INFO org.jsmpp.examples.StressClient -
Starting send 100000000 bulk message...
2008-11-20 21:53:51,553 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
1819/1809 of 1809 maxDelay=166
2008-11-20 21:53:52,788 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
938/938 of 2747 maxDelay=219
2008-11-20 21:53:54,474 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
663/663 of 3410 maxDelay=148
2008-11-20 21:53:56,309 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
1611/1611 of 5021 maxDelay=945
2008-11-20 21:53:58,630 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
842/842 of 5863 maxDelay=1324
2008-11-20 21:54:01,684 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
991/991 of 6854 maxDelay=1789
2008-11-20 21:54:04,802 [pool-1-thread-4] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8293'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8295
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,803 [pool-1-thread-10] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8294'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8296
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-5] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8295'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8297
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-3] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8296'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8298
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-7] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8297'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8299
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-2-thread-1] WARN
org.jsmpp.session.state.SMPPSessionBoundTX - No request with sequence
number 8295 found
2008-11-20 21:54:04,804 [pool-1-thread-9] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8302'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8304
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-8] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8298'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8300
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [Thread-2] INFO
org.jsmpp.examples.StressClient - Request/Response per second :
1440/1439 of 8293 maxDelay=2358
2008-11-20 21:54:04,804 [pool-1-thread-6] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8301'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8303
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-1] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8300'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8302
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,804 [pool-1-thread-2] ERROR
org.jsmpp.examples.StressClient - Failed submit short message 'Hello
Hello Hello Hello Hello Hello Hello Hello Hello Hello 0 idx=8299'
org.jsmpp.extra.ResponseTimeoutException: No response after waiting
for 2000 millis when executing submit_sm with sessionId d8d0fb95 and
sequenceNumber 8301
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:261)
at org.jsmpp.session.SMPPSession.submitShortMessage
(SMPPSession.java:318)
at org.jsmpp.examples.StressClient$1.run(StressClient.java:
149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jsmpp.extra.ResponseTimeoutException: No response after
2000 millis
at org.jsmpp.extra.PendingResponse.waitDone
(PendingResponse.java:117)
at org.jsmpp.session.AbstractSession.executeSendCommand
(AbstractSession.java:257)
... 5 more
2008-11-20 21:54:04,807 [pool-2-thread-3] WARN
org.jsmpp.session.state.SMPPSessionBoundTX - No request with sequence
number 8296 found
2008-11-20 21:54:04,807 [pool-2-thread-2] WARN
org.jsmpp.session.state.SMPPSessionBoundTX - No request with sequence
number 8297 found
.....................


Could you proivde a class to support 3 × 24 hours stress test ?

By the way, I use my own application with openSMPP2.0 protocol stack
to send message to StressServer,
at the begining the highest TPS is 1000, then the TPS go down 400~
700.


2) Why not use java.nio ?

3) no String encoding ?

In PDUByteBuffer.java:

public int append(String stringValue, boolean nullTerminated) {
if (stringValue != null)
append(stringValue.getBytes());
if (nullTerminated)
append((byte)0);
return bytesLength;
}

In ByteBuffer.java (openSMPP2.0):

private void appendString0(String string, boolean isCString, String
encoding) throws UnsupportedEncodingException {
if ((string != null) && (string.length() > 0)) {
byte[] stringBuf = null;
if (encoding != null) {
stringBuf = string.getBytes(encoding);
} else {
stringBuf = string.getBytes();
}
if ((stringBuf != null) && (stringBuf.length > 0)) {
appendBytes0(stringBuf, stringBuf.length);
}
}
if (isCString) {
appendBytes0(zero, 1); // always append terminating zero
}
}

4) In some interfaces, like PDUComposer, the method parameters is not
objects.
for example:

byte[] submitSm(int sequenceNumber, String serviceType, byte
sourceAddrTon,
byte sourceAddrNpi, String sourceAddr, byte destAddrTon,
byte destAddrNpi, String destinationAddr, byte esmClass,
byte protocolId, byte priorityFlag, String
scheduleDeliveryTime,
String validityPeriod, byte registeredDelivery,
byte replaceIfPresentFlag, byte dataCoding, byte
smDefaultMsgId,
byte[] shortMessage, OptionalParameter...
optionalParameters)
throws PDUStringException;

Maybe it is better:
byte[] submitSm(SubmitSM submitSM)


Regards!!!

uud ashr

unread,
Nov 20, 2008, 3:21:14 AM11/20/08
to js...@googlegroups.com
What you want to use? Server API or Client API?

Hi, the ResponseTimeoutException occurs when the the response take time more than 2000 millisecond. So the server can't respond to a request stable, that might caused by the stable hi load traffic, the JVM might run the GC. Thats why we define transaction time, so if you not satisfy, reset the transaction time to 10000 milissecond SMPPSession#setTransactionTimer(10000), to make it safe.
Of course it's depend to your hardware. To know you should do a testing, how good your server are.

Afterwards, to achieve a good SMPP Server, you should apply throttle, to limitate the traffic per time unit (per seconds), ensure there is no client try to bomb your SMPP Server (if you plan to create SMPP Server)
 
The stress server is a very simple, but if you create SMPP Server and add some logic such as inserting to database, you should apply a tricky strategy in order to give a quick response to a client.



Could you proivde a class to support 3 × 24 hours stress test ?

You can modify the stress client for unlimited messages.
 


By the way, I use my own application with openSMPP2.0 protocol stack
to send message to StressServer,
at the begining  the highest TPS is 1000, then the TPS go down  400~
700.

Shouldn't be that worst.
Can you explain the scenario? how many session? TPS per session? How long?
 


2) Why not use java.nio ?

Well, i'm not familiar with NIO when I build this. Now I didnt' have much time to do a re-code. :-D
 Are honored enough to modify JSMPP using java.nio? :-P


3)  no String encoding ?

 In PDUByteBuffer.java:

   public int append(String stringValue, boolean nullTerminated) {
       if (stringValue != null)
           append(stringValue.getBytes());
       if (nullTerminated)
           append((byte)0);
       return bytesLength;
   }

 In  ByteBuffer.java (openSMPP2.0):

       private void appendString0(String string, boolean isCString, String
encoding) throws UnsupportedEncodingException {
               if ((string != null) && (string.length() > 0)) {
                       byte[] stringBuf = null;
                       if (encoding != null) {
                               stringBuf = string.getBytes(encoding);
                       } else {
                               stringBuf = string.getBytes();
                       }
                       if ((stringBuf != null) && (stringBuf.length > 0)) {
                               appendBytes0(stringBuf, stringBuf.length);
                       }
               }
               if (isCString) {
                       appendBytes0(zero, 1); // always append terminating zero
               }
       }

I didn't know much about this, since I use the standard one. Can you explain more about this, so I can imagine the case using string encoding.
Right now I assume the string encoding is done manually by the user when constructing String.
 

4) In some interfaces, like PDUComposer, the method parameters is not
objects.
   for example:

byte[] submitSm(int sequenceNumber, String serviceType, byte
sourceAddrTon,
           byte sourceAddrNpi, String sourceAddr, byte destAddrTon,
           byte destAddrNpi, String destinationAddr, byte esmClass,
           byte protocolId, byte priorityFlag, String
scheduleDeliveryTime,
           String validityPeriod, byte registeredDelivery,
           byte replaceIfPresentFlag, byte dataCoding, byte
smDefaultMsgId,
           byte[] shortMessage, OptionalParameter...
optionalParameters)
           throws PDUStringException;

Maybe it is better:
  byte[] submitSm(SubmitSM submitSM)

At first I was create this API, I create an interface to compose the parameters of submit_sm command into a PDU, there is no SubmitSM object yet. So I think it just a utility class, end user will not use this PDUComposer, no state, just behavior.
But there is no problem if the utility class need to be change, it just change on the internal API, not gonna change how the API is use by user.
 


Regards!!!


zhaolon...@gmail.com

unread,
Nov 20, 2008, 4:41:28 AM11/20/08
to jsmpp


> What you want to use? Server API or Client API?

Actually I want to figure out your JSMPP how to able to handle traffic
3000-5000 messages per second.

how to get excellent performance ?

>
> Hi, the ResponseTimeoutException occurs when the the response take time more
> than 2000 millisecond. So the server can't respond to a request stable, that
> might caused by the stable hi load traffic, the JVM might run the GC. Thats
> why we define transaction time, so if you not satisfy, reset the transaction
> time to 10000 milissecond SMPPSession#setTransactionTimer(10000), to make it
> safe.
> Of course it's depend to your hardware. To know you should do a testing, how
> good your server are.
>
> Afterwards, to achieve a good SMPP Server, you should apply throttle, to
> limitate the traffic per time unit (per seconds), ensure there is no client
> try to bomb your SMPP Server (if you plan to create SMPP Server)
>
> The stress server is a very simple, but if you create SMPP Server and add
> some logic such as inserting to database, you should apply a tricky strategy
> in order to give a quick response to a client.


Actually I have set TransactionTimer = 10000, but it is worse....

>
> > Could you proivde a class to support 3 × 24 hours stress test ?
>
> You can modify the stress client for unlimited messages.
>


Actually I have modified the stress client for unlimited messages, but
it is worse....

>
> > By the way, I use my own application with openSMPP2.0 protocol stack
> > to send message to StressServer,
> > at the begining the highest TPS is 1000, then the TPS go down 400~
> > 700.
>
> Shouldn't be that worst.
> Can you explain the scenario? how many session? TPS per session? How long?

two client(with my own application: one is the Transmitter which sends
submitSM message to server continuously, one is the Receiver which
does nothing),
one server(with Stress Server) , for 24 hours.



By the way, I am a tester working on communication industry in china,
I am interested in Java programming.
I am going on with reading your JMPP sourcecode recently. I was a
developer before this year and I wish to communicate with you....

MSN: longr...@hotmail.com

Regards!!!

uud ashr

unread,
Nov 20, 2008, 5:10:27 AM11/20/08
to js...@googlegroups.com






> What you want to use? Server API or Client API?

Actually I want to figure out your JSMPP how to able to handle traffic
3000-5000 messages per second.

how to get excellent performance ?

If you create an application based on JSMPP, it wouldn't be that fast. Because there will be interaction with other API with various logic that my slow down the application. Thats why you need a trick in order to achieve performance.

You can execute the stress/runServer.sh and stress/runClient.sh to prove it. It tested on Lenovo Laptop core 2 duo2 GHz with 2G RAM.
So, you are testing you SMPP Server with jsmpp? 



By the way, I am a tester working on communication industry in china,
I am interested in Java programming.
I am going on with reading your JMPP sourcecode recently. I was a
developer before this year and I wish to communicate with you....

Well nice to communicate with you too, you can contact me on my gmail, email or google talk.
 

MSN: longr...@hotmail.com

Regards!!!


Reply all
Reply to author
Forward
0 new messages