Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

JavaScript
branch: master

README

+------------------------------------------------------------------------------+
| An XMPP BOSH server stress tool written using Node.js in Javascript |
+------------------------------------------------------------------------------+

Project Home Page: https://github.com/anoopc/node-bosh-stress-tool


[A] 	Introduction: It is a tool to stress test a bosh server on one hand 
	while on the other it can be used to find latency in reponse at 
	a desired remote location. First of all it tries to authenticate 
	multiple clients simultaneously with the xmpp server each going 
	through following steps:
		a: bosh session creation
		b: SASL authentication using PLAIN mechanism
		c: stream restart
		d: resource binding
		e: session binding
	After successful completion of above steps user gets online(has an 
	established session with corresponding xmpp server).Now it can be 
	used in two different modes(1.Bombarding mode 2.normal mode).In 
	bombarding mode each of the above clients start sending sample 
	messages to themselves via bosh. As soon as they receive previously 
	sent message,they send another self-destined message. All the clients 
	keep doing this for a predefined time simultaneously and the response 
	times are recorded for analysis.In normal mode each of the above 
	established clients send messages to themselves in a longer interval
	(say every 30 seconds).So now instead of bombarding the server we can 
	find the average response time a normal user expects.


[B] 	Log Levels(in order):
		FATAL:	displays nothing
		ERROR:	displays error messages
		DATA:	displays statistics
		INFO:	informs about important events
		DEBUG:	prints each packet sent and received


[C]	Statistics interpretation:[each of the following is recorded since 
	the last statistics printed]
		Total_Responses_Received:		total no. of http responses received by the application
		Total_Established_Clients:		total number of established clients
		Mean_Time_Lag:				mean time lag over all the received messages
		Max_Time_Lag:				max time lag over all the received messages
		Total_Messages_Sent_Per_Client:		number of messages sent per client on average
		Total_Messages_Received_Per_Client:	number of messages received per client on average
		Error %:				percentage of messages received with time lag > message_timeout


[D] Command line options interpretation:
	
	Usage:

	The BOSH service endpoint (default: http://localhost:5280/http-bind/)
	    --end_point
	The route attribute to use (default: "")
	    --xmpp_route
	The number of sessions to open (default: 1)
	    --total_sessions
	The Log level you want (default: INFO)
	    --logging_level
	which clients u want to create(default: 1)
	    --start
	Upper limit of time lag for messages recieved to be declared as error in seconds(default: 7)
	    --message_timeout
	mode in which clients operate (1.Bombarding 2.Normal mode)(default: 1)
	    --operating_mode
	while operating in normal mode, interval between two consecutive messages from a client(default: 5)
	    --message_interval
	statistics logging interval in seconds(default: 60)
	    --data_interval
	terminate the program after this time in minutes(default: 20)
	    --record_time
	Help. This message.
	    --help



[E] Quick Start:

    [1] To run, type:
    $ node <path-to-project>/boshclient.js <requisite arguments>

    [2] For options, type:
    $ node <path-to-project>/boshclient.js --help

    [3] For a more complex setup, see the file boshclient.js[function main() in particular]

[F] Directions: 
	[1]:	while creating a number of clients it may be convenient to use the usernames like 
		(user1@example.com, user2@example.com, user3@example.com etc.) having same or 
		logically related passwords(you know what i mean by logically related :P). you can 
		set the credentials to login in file boshclient.js(function start_test() in particular).
	[2]:	if you want to run multiple instances of this program each logging in a different set 
		of users, you can use 'start' attribute in the command line to set that(program will 
		login user<start>@example.com to user<start+nsess-1>@example.com users by default).
	[3]:	your xmpp server or bosh server might be configured to avoid being bombarded by any 
		client beyond a threshold no. of messages per unit time.So keep the configuration as 
		required while using the program in the bombarding mode.


********************HAPPY CODING and HAPPY NODING******************************
Something went wrong with that request. Please try again.