Recently the Mojo Lingo team has done a lot of work to improve the performance of Adhearsion, both internally to the project as well as when used in applications for some of our clients. The best way to observe the performance of something is to load it up and see where it falls down. In the telephony/VoIP world, load testing is often done with an Open Source tool known as SIPp. SIPp is truly great; I know of no other Open Source telephony testing tool that is as efficient at generating load and as flexible in what can be generated. For an introduction to load testing with SIPp, check out Luca's great article on the subject.
SIPp is great, but...
As great as SIPp is however, it's not the easiest thing to use. It requires test scenarios to be written in a fairly verbose XML format. But even if you love XML, the real pain is lining up the call media. In our world, load tests usually need to interact like a human caller might. This primarily means sending DTMF button presses to the voice application. SIPp doesn't send media by default, and it gets upset if you try to re-use/loop a single silent audio file (at least, it does without a third-party patch). But even then, it's very easy to sleep just a little too long and have your telephony engine hang up for lack of received media. Usually this forces us to record an interaction with the application, then use SIPp to play that interaction back. But that makes setting up new test scenarios rather time consuming. Wouldn't it be great if we could just describe the interactions in a test format, and have something construct the media for us?
Enter Sippy Cup
Yes, that would be great! Enter Sippy Cup. Sippy Cup is designed to make creating SIPp scenarios as painless as possible. And after creating your scenario, it can even test and log the results for you. No more remembering the arcane command line options!
Sippy Cup Scenario Steps
The syntax for creating a test scenario is designed to be as friendly as possible. As of the v0.2.0 release, here are the commands you can use in your test runs:
sleep <seconds>Wait a specified number of secondsinviteSend a SIP INVITE to the specified targetreceive_tryingExpect to receive a100 Tryingresponse from the targetreceive_ringingExpect to receive a180 Ringingresponse from the targetreceive_progressExpect to receive a183 Progressresponse from the targetreceive_answerExpect to receive a200 OK(answering the call) response from the targetwait_for_answerConvenient shortcut forreceive_trying; receive_ringing; receive_progress; receive_answer, with all but theanswermarked as optionalack_answerSend anACKin response to a200 OKsend_digits <string>Send a DTMF string. May send one or many digits, including0-9,*,#, andA-Dsend_byeSend aBYE(hangup request)receive_byeExpect to receive aBYEfrom the targetack_byeSend anACKin response to aBYEwait_for_hangupConvenient shortcut forreceive_bye; ack_bye
Running Sippy Cup
Given some basic information about the test, including the source and destination addresses, the number of calls to send, and these instructions, we can generate a SIPp scenario and accompanying audio file in PCAP format. Here's a complete example:
$ cat my_scenario.yml --- source: 192.0.2.15 destination: 192.0.2.200 max_concurrent: 10 calls_per_second: 5 number_of_calls: 20 steps: - invite - wait_for_answer - ack_answer - sleep 3 - send_digits '3125551234' - sleep 5 - send_digits '#' - wait_for_bye $ sippy_cup -c my_scenario.yml Compiling media to my_test_scenario.pcap...done. Compiling scenario to my_test_scenario.xml...done.
Now you can take the my_test_scenario.xml and run it with SIPp. Or, you can let Sippy Cup do it for you:
$ sippy_cup -r my_scenario.yml Preparing to run SIPp command: "sudo sipp -i 192.0.2.15 -p 8836 -sf /Users/bklang/src/sippy_cup/my_test_scenario.xml -l 10 -m 20 -r 5 -s 1 > /dev/null 2>&1" # test run output removed
Get Started!
For more information on the Sippy Cup project, check out the Sippy Cup home page or check out the code on Github. And get to testing those voice applications!
The post Introducing Sippy Cup: SIPp Load Testing Made Easy appeared first on Mojo Lingo.