saoj
Joined: 05/09/2008 13:26:12
Messages: 15
Offline
|
To stress test Space4J's cluster implementation, let's place a master node and a slave node under stress doing many reads and updates. Each node will have a predefined number of threads doing insert, delete, search and iteration at the same time in the Java collection in memory. A snapshot will also be taken from time to time by the slave node.
You can download the PhoneBookClusterStress.java program by clicking here. The source code is also listed below. (Note that to compile and run this problem you must include the space4.jar in the classpath)
To run this example you need to open two shell/dos windows, one for the master node and one for the slave node. You can also run each node in a separate machine over the network.
The arguments you must pass to the each program are:
-master or -slave = to indicate if this node is the master or the slave
IP address of the master
number of insert threads
number of delete threads
number of select threads
number of search threads
thread sleep time = how long each thread will sleep after each action
collection initial size = how many elements should the collection has before the threads start
snapshot time = how often should we take a snapshot
After executing the programs for some time, hit CTRL+C to print the statistics. Here is an example:
Master Program:
Slave Program:
The source code of the PhoneBookClusterStress.java program:
This message was edited 7 times. Last update was at 05/09/2008 16:24:04
|