I have Tsung loaded on one EC2 instance, i also have another EC2 instance with eJabberd. I want to load test eJabberd with Tsung.All ports and security groups are configure to all inbound, and all outbound.
Error that i get:
ssh: Could not resolve hostname ec2-xx-xxx-xxx-xxx: Name or service not known
For reference my Tsung configuration:
<clients>
<client host="ec2-xx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com" use_controller_vm="true" maxusers="15000"></client>
</clients>
<servers>
<server host="xx.xxx.xxx.xxx" port="5222" type="tcp"></server>
</servers>
<load>
<arrivalphase phase="1" duration="10" unit="minute">
<users maxnumber="15000" interarrival="0.04" unit="second"></users>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="15000"></option>
<option type="ts_jabber" name="userid_max" value="15000"></option>
<option type="ts_jabber" name="domain" value="http://www.ec2-xx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com"></option>
<option type="ts_jabber" name="username" value=""></option>
<option type="ts_jabber" name="passwd" value="test"></option>
</options>
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request><jabber type="connect" ack="local"></jabber></request>
<thinktime value="2"></thinktime>
<transaction name="authenticate">
<request> <jabber type="auth_get" ack="local"></jabber></request>
<request> <jabber type="auth_set_plain" ack="local"></jabber></request>
</transaction>
<request><jabber type="presence:initial" ack="global"></jabber></request>
<thinktime value="600"></thinktime>
<transaction name="close">
<request> <jabber type="close" ack="local"></jabber></request>
</transaction>
</session>
</sessions>
In your case, set client host to 'localhost':
<client host="localhost" ...
If you have more tsung installed machines, they are connected via ssh. So check connectivity with ssh from the shell.
If you read http://tsung.erlang-projects.org/user_manual/conf-client-server.html and http://tsung.erlang-projects.org/user_manual/faq.html , you'll get useful information.
Related
I have setup xml file, I think there ssl certificate issue while I am hitting http request in tsung.
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true" version="1.0">
<clients>
<client host="localhost" maxusers="1" use_controller_vm="true"/>
</clients>
<servers>
<server host="hostname.com" port="443" type="ssl"></server>
</servers>
<load>
<arrivalphase phase="1" duration="1" unit="minute">
<users arrivalrate="1" unit="second"/>
</arrivalphase>
</load>
<sessions>
<session name="http_test_1" probability="100" type="ts_http">
<request subst="true">
<dyn_variable name="redirect" re="Location: (http://.*)\r"/>
<http url="/users/sign_in" contents='{"user": {"email": "vishal.jagtap+51#zibtek.com","password": "tudip123"}}' content_type='application/json' method="POST" version="1.1">
</http>
</request>
<thinktime random='true' value='27'/>
<repeat name="redirect_loop" max_repeat="5">
<request subst="true">
<dyn_variable name="redirect" re="Location: (http://.*)\r"/>
<http url="%%_redirect%%" method="GET"></http>
</request>
<until var="redirect" eq=""/>
</repeat>
<request>
<http url="/users/edit" method="GET" version="1.1">
</http>
</request>
</session>
</sessions>
</tsung>
in tsung.dump I get 302, how can I hit https request is there any way or any configuration in xml?
please please please help me here! I am stuck from 3 days :(
Try with the ip or just the hostname here not .com.
<servers>
<server host="HOSTNAME_HERE" port="443" type="ssl"></server>
</servers>
Refer the this
Recently we have started investigating possibilities of creating load test script using Tsung tool to run against our XMPP server(Openfire).
I am using load balancer address as server server configuration, which distributes the load between Openfire cluster nodes and websocket port number is 7443.ATM my goal is to log into server using credentials and get the room count from server in particular venture.
Some how my script is unable to make requests to load balancer, I have verified in XMPP server logs just to make sure. I am not sure what I am missing in the configuration to make a successful authentication request, can some one help me to fix this please.
Protocol: Websocket
Port: 7743 (SSL)
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM '/home/prasad/Documents/tsung-1.6.0/tsung-1.0.dtd'>
<tsung loglevel='info' dumptraffic='false' version='1.0'>
<clients>
<client host='localhost' use_controller_vm='false'/>
</clients>
<servers>
<server host='chat.ppc1.pgt01.gamesysgames.com' port='7443' type='websocket'/>
</servers>
<load>
<arrivalphase phase="1" duration="2" unit="minute">
<users interarrival="2" unit="second"></users>
</arrivalphase>
</load>
<options>
<option type='ts_jabber' name='global_number' value='100000' />
<option type='ts_jabber' name='userid_max' value='100000' />
<option type='ts_jabber' name='domain' value='chat' />
<option type='ts_jabber' name='muc_service' value='jackpotjoy.chat' />
<option name="websocket_path" value='/ws' />
</options>
<sessions>
<session probability="100" name="websocket-example" type="ts_jabber">
<request>
<jabber type="connect" ack='local'>
<xmpp_authenticate username='' passwd='<VENTURE>jackpotjoy</VENTURE><TOKEN TYPE="1"><PUBLIC><MEMBER-ID>18118300</MEMBER-ID><NAME>media1</NAME><EXPIRY-DATE>1467207433297</EXPIRY-DATE></PUBLIC><CIPHER-TEXT><![CDATA[O9jTn2YZzMFwcLPdLbwiQ/PlKG5X47w6JYlfWJ6Yh+50XMcpWEHuGs0Q1qI9IjjpU1/n7cUsEc0MPsxyUkXexgMdMZqdhMG5+Kczf2T8Ma2JvzCYMIjnkuuqwUMhigVF28nhrfFLSeSVbv2PhWJ7XUedarkkVibKrVnQkkvCqkGB5oXZixu/TTJzpqb/wjuTOqRa+vmwz8l2Ljp/0hb/e3MHyLNcd21S]]></CIPHER-TEXT></TOKEN>'/>
</jabber>
</request>
<transaction name='authenticate'>
<request>
<jabber type='auth_sasl' ack='local' />
</request>
<request>
<jabber type='connect' ack='local' />
</request>
<request>
<jabber type='auth_sasl_bind' ack='local' />
</request>
<request>
<jabber type='auth_sasl_session' ack='local'/>
</request>
</transaction>
<request>
<jabber type='presence:initial' ack='local' />
</request>
<transaction name='roster'>
<request>
<jabber type='iq:roster:get' ack='local'></jabber>
</request>
</transaction>
<transaction name='get_roomcount'>
<request>
<jabber type='raw' ack='local' data='<iq to="jackpotjoy#chat" type="get"><query
xmlns="http://jabber.org/protocol/disco#items" node="roomcount" /></iq>'/>
</request>
</transaction>
<transaction name='close'>
<request>
<jabber type="close" ack='local' />
</request>
</transaction>
</session>
</sessions>
</tsung>
I don't see any error messages in logs, can someone help me please.
Sorry,I can only speak a little English.
You can try to modify dumptraffic = 'true' and set loglevel attribute.
Please look the Tsung User's manual:
6.1. File structure
If you add the attribute dumptraffic=”true”, all the traffic will be logged to a file.
My idle KVM Windows VM used 100% CPU.
It went from 100% host CPU down to 3% host CPU after I disabled ehci(Standard Enhanced PCI to USB Host Controller) in Device Manager.
Device Magener Picture
Vm run normally at the beginning. It went up to 100% after a long timer(may be one night long).
Why the cpu usage reduced when I disabled the ehci?
Is there any other way to reduce the cpu usage?
Here is my libvirt.xml
<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
<name>i-win2003/name>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<clock offset="localtime"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<vcpu current="1">1</vcpu>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<devices>
<disk device="disk" type="file">
<driver name="qemu" type="qcow2"/>
<source file="/root/i-win2003/snap.qcow2"/>
<target bus="virtio" dev="vda"/>
</disk>
<disk type='file' device='cdrom'>
<source dev=''/>
<target dev='hdc' bus='ide'/>
</disk>
<serial type="pty">
<source path="/dev/pts/1"/>
<target port="0"/>
</serial>
<interface type='bridge'>
<mac address='fa:16:3e:81:68:b4'/>
<source bridge='eucabr'/>
<model type='virtio'/>
<driver name='qemu'/>
<alias name='net0'/>
</interface>
<channel type='unix'>
<source mode='bind'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1"/>
<controller type="usb" index="0" model="ich9-uhci2"/>
<controller type="usb" index="0" model="ich9-uhci3"/>
<input type="tablet" bus="usb"/>
<input type="mouse" bus="ps2"/>
<graphics type="vnc" port="-1" autoport="yes" keymap="en-us" listen="0.0.0.0"/>
</devices>
<qemu:commandline>
</qemu:commandline>
</domain>
I am trying to load test a websocket server. Server accepts and sends application/json and interactions seems to be rather fine.
Server accepts correctly messages sent from client (tsung). Unfortunately from the client perspective it can't read responses and I think might be related to the fact messages are garble at least looking at tsung.dump I see ASCII characters like NUL, SOH, SI, etc but I also see json responses from the server somehow ok.
This is my tsung.xml file snippet:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.5.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="1000" />
</clients>
<servers>
<server host="127.0.0.1" port="8282" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="120" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<sessions>
<session name="websocket" probability="100" type="ts_websocket">
<request subst="true">
<websocket type="connect" path="/fancyurl?Content-Type=application/json"></websocket>
</request>
<transaction name="getsession">
<request subst="true">
<dyn_variable name="sessionid" jsonpath="session"/>
<websocket type="message">{"type": "EventMessageCmd", "user": "lnramirez", "eventCode" : "epfl"}
</websocket>
</request>
</transaction>
<thinktime value="10"/>
<request>
<dyn_variable name="boothAck" jsonpath="commandStatus" />
<websocket type="message">
{
"user": "lramirezmonterosa",
"eventCode": "epfl",
"type": "BoothMessageCmd",
"boothCode": "ic",
"commandStatus": "REQUESTED",
"boothRequest": "JOIN"
}
</websocket>
</request>
<request>
<websocket type="close"></websocket>
</request>
</session>
</sessions>
</tsung>
tsung.dump:
Send:1390970727.56257:<0.84.0>:‚ìÝju¦`U_ýJU_ýJU_ýJU_ÿ¸HO_ÿ/³8®¸)ÿFU]¨
ÿPU]±´°¸¼HY_ÿ³6¹W_çJW]×JU_ýJU_ýJU_ýJU
Recv:1390970727.588689<0.84.0>:~{"type":"HeartBeatMessageCmd","timeCmdBroadcasted":1390970727588,"timeCmdGenerated":1390970727588,"commandStatus":"REQUESTED","user":"lramirezmonterosa","eventCode":"epfl","uuid":"a91e2c1b-859d-4299-99fd-e7ba63ba1f42","userSession":"25bb5627-4eb3-4a23-a1c9-edd5b8231808"}`
My question is about configuring my tsung.xml file to load-test chat application.
So, we have our MongooseIM server on the server side, jsjac.js library for our web-based client. We use xmpp and websockets to communicate.
httpbase for jsjac is looks like ws://hostname:5288/ws-xmpp/ and this part works fine for me. Tsung is supports websockets "from the box" and everybody says that the best way to test websockets - is to use tsung. But there is not so much information about how to do that.
Here is my tsung.xml:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="10" />
</clients>
<servers>
<server host="hostname" port="5288" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="10" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<sessions>
<session name="websocket" probability="100" type="ts_websocket">
<request subst="true">
<websocket type="connect" path="/ws-xmpp"></websocket>
</request>
<request>
<dyn_variable name="uid" jsonpath="uid"/>
<websocket type="message">{"user":"bob", "password":"bob"}</websocket>
</request>
<request subst="true">
<match do="log" when="nomatch">ok</match>
<websocket type="message">{"uid":"%%_uid%%", "data":"data"}</websocket>
</request>
<request>
<websocket type ="message">{"key":"value"}</websocket>
</request>
<request>
<websocket type="close"></websocket>
</request>
</session>
</sessions>
</tsung>
and after test passed the result is:
connected: 0
finish_users_count: 1
users: 1
users count: 1
websocket_succ: 1
user "bob" is really exist in server's db and works fine via client application.
Can anybody tell me what i'm doing wrong?
Or maybe someone could provide a link to some article or working xml file?
Thanks.
Best way to test XMPP over Websockets is to use standard Jabber scenario with specific server configuration:
<servers>
<server host="localhost" port="5288" type="websocket"></server>
</servers>
<options>
(...)
<option name="websocket_path" value="/ws-xmpp"/>
</options>
Sample Jabber scenario can be found e.g. in "examples" directory in Tsung repo. I think plaintext login is used there so if you'll still have problem connecting users, replace transaction "authenticate" with:
<transaction name="authenticate">
<request><jabber type="auth_sasl" ack="local" /></request>
<request><jabber type="connect" ack="local" /></request>
<request><jabber type="auth_sasl_bind" ack="local" /></request>
<request><jabber type="auth_sasl_session" ack="local" /></request>
</transaction>
There was a couple of things to do... so,first of all, BIG THANKS to Piotr!
his response (+ jabber scenario example) has helped to solve my problem
here is my working tsung.xml
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true"></client>
</clients>
<!-- Server side setup -->
<servers>
<server host="servernameOrIp" port="5288" type="websocket"></server>
</servers>
<load>
<arrivalphase phase="1" duration="20" unit="second">
<users interarrival="1" unit="second"></users>
</arrivalphase>
</load>
<!-- JABBER parameters -->
<options>
<option type="ts_jabber" name="global_number" value="20"></option>
<option type="ts_jabber" name="userid_max" value="20"></option>
<option type="ts_jabber" name="domain" value="servernameOrIp"></option>
<option type="ts_jabber" name="username" value="user00"></option>
<option type="ts_jabber" name="passwd" value="user00"></option>
<option name="websocket_path" value="/ws-xmpp"/>
</options>
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request> <jabber type="connect" ack="no_ack"></jabber> </request>
<thinktime value="2"></thinktime>
<transaction name="authenticate">
<request><jabber type="auth_sasl" ack="local" /></request>
<request><jabber type="connect" ack="local" /></request>
<request><jabber type="auth_sasl_bind" ack="local" /></request>
<request><jabber type="auth_sasl_session" ack="local" /></request>
</transaction>
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
<thinktime value="10"></thinktime>
<transaction name="roster">
<request> <jabber type="iq:roster:get" ack="local"></jabber></request>
</transaction>
<thinktime value="10"></thinktime>
<transaction name="online">
<request> <jabber type="chat" ack="no_ack" size="16" destination="online"></jabber> </request>
</transaction>
<thinktime value="10"></thinktime>
<transaction name="offline">
<request> <jabber type="chat" ack="no_ack" size="56" destination="offline"></jabber> </request>
</transaction>
<thinktime value="2"></thinktime>
<transaction name="close">
<request> <jabber type="close" ack="no_ack"></jabber> </request>
</transaction>
</session>
</sessions>
</tsung>
with this tsung is generates 20 users (user001 - user0020) and i can see them all in my "bob's" roster. I use a Spark IM client to monitor this.