Setup
The cosmo stress tests are written in Ruby, and you will need version 1.8.5 or later. For instructions on installing Ruby, go
here.
You'll then need to install rubygems. Instructions
here.
You'll then need to use rubygems to install log4r:
$ gem --remote-install log4r
Running tests
Go in to the stress test directory and invoke cosmo_user_runner.rb -h for options.
$ ./cosmo_user_runner.rb -h
Usage: ./cosmo_user_runner.rb [options]
-s, --server [SERVER] server address (default localhost)
-c, --context [CONTEXT] application context (default chandler)
-p, --port [PORT] server port (default 8080)
-U, --user [USER] username (default root)
-P, --password [PASSWORD] password (default cosmo)
-m, --mix x,y,z Mix of client threads ([num mc],[num ataom],[num caldav]) (default 1,0,0)
-T, --time [TIME] thread execution time
-i, --iterations [ITERATIONS] number of iterations per thread (default 100)
-r, --rounds [ROUNDS] number of rounds (default 1)
-S, --stats [STATS_SEVER] stats server
-v, --verbose enable verbose output
-h, --help Show this message
cosmo_user_runner.rb allows a variety of command line arguments to setup a stress test run. A stress run consists of a number of threads issuing requests to a cosmo server. There are 3 types of threads:
- CalDAV user - simulates a number of CalDAV users
- morse code user - simulates a number of morse code users
- atom user - simulates a number of atom users
Each thread randomly issues requests based on a probability matrix, and uses randomly generated data. The cosmo_user_runner.rb program allows you to control the number and mix of threads spawned, and how long they run. Statistics for each request type are printed out at the end of a stress run. It is possible to startup multiple runs using more than one client computer to simulate thousands of simultaneous users.
To execute a simple test run consisting of a single thread per protocol (3 users created) lasting for 1 hour:
$ ./cosmo_user_runner --m 1,1,1 -T 3600
For 3 morse code threads, 2 atom threads, 1 caldav thread running for 10 minutes and then repeating 10 times (total running time of 100 minutes, 60 users created):
$ ./cosmo_user_runner --m 3,2,1 -T 600 -r 10
Extras
To setup a distributed test run on multiple client machines do the following:
Setup stats collecting machine by starting stats server:
machine1$ ./stats_server.rb
Start multiple cosmo_user_runner instances (one per machine):
machine2$ ./cosmo_user_runner.rb -s server.address -m 10,10,10 -T 600 -r 100 -S machine1
machine3$ ./cosmo_user_runner.rb -s server.address -m 10,10,10 -T 600 -r 100 -S machine1
This results in machine2 and machine3 each creating 30 stress threads and reporting results to machine1, where the stats_server is running. At the end of each run, results will be printed.
--
RandyLetness - 02 Jul 2008