PCampBot
From OpenSimulator
Contents |
Instructions for pCampbot as of OpenSimulator 0.7.6
pCampBot has changed considerably in OpenSimulator development code. Here is the current usage statement that you'll get if you execute pCampBot.exe as of OpenSimulator 0.7.6.
usage: pCampBot <-loginuri loginuri> [OPTIONS] Spawns a set of bots to test an OpenSim region -l, -loginuri loginuri for grid/standalone (required) -s, -start start location for bots (optional). Can be "last", "home" or a specific location with or without co-ords (e.g. "region1" or "region2/50/30/90" -firstname first name for the bots (required) -lastname lastname for the bots (required). Each lastname will have _<bot-number> appended, e.g. Ima Bot_0 -password password for the bots (required) -n, -botcount number of bots to start (default: 1) (optional) -f, -from starting number for login bot names, e.g. 25 will login Ima Bot_25, Ima Bot_26, etc. (default: 0) (optional) -c, -connect connect all bots at startup (optional) -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p (required) current options are: p (physics - bots constantly move and jump around) g (grab - bots randomly click prims whether set clickable or not) n (none - bots do nothing) t (teleport - bots regularly teleport between regions on the grid) -wear folder from which to load appearance data, "no" if there is no such folder (default: no) (optional) -h, -help show this message.
You must have already created all the necessary bot accounts in the simulator before using pCampbot. It does not create these accounts on the fly.
The -wear option almost certainly doesn't work. The others are operational.
On using this facility you'll get a console command line similar to the one in OpenSimulator and Robust. Type help on this prompt to see further commands.
Optional pCampbot.ini configuration
pCampbot has some further optional configuration options relating to detailed bot behaviour in pCampbot.ini.example. To change these from the defaults
cp pCampbot.ini.example pCampbot.ini
and change pCampbot.ini accordingly.
Example
Okay, let's suppose that we're on Linux and want to create a 5 bot synthetic load test on a region called myregion1. Depending on your bandwidth and the bot settings you can connect quite a large number of bots but for this example we will stick with 5. Here are the steps to take.
Step 1: Create bot accounts
The first step is to create 5 bot accounts, all with the same password. Each bot account must have the same first name and the same last name prefix. But each bot must also have its last name prefix appended with an underscore (_) and its bot number, starting from 0. In this case, we want five bots, and lets suppose we will call them "ima bot". Then the five accounts that we want are
ima bot_0 ima bot_1 ima bot_2 ima bot_3 ima bot_4
The classic way to create a user account is to do it by using the "create user" command on the OpenSimulator standalone or Robust service console, depending on whether one is running in standalone or grid mode. However, this can be laborious, particularly if one needs hundreds of bot accounts. There's a very basic python script at https://github.com/justincc/opensimulator-tools/blob/master/create-user-line-generator/src/culg.py which will generate the user lines needed, giving each account a non-random UUID for later debugging purposes. The lines that this script generated can be pasted directly into the OpenSimulator console.
Step 2: Start pCampbot
The next step is to start up pCampbot with the required connection parameters. Let us suppose that you want to test against a region called "r1" on a local grid with a loginuri of http://192.168.1.2:8002. Let us assume that you've given the bots the password "plentyofruth". The command to run is then
mono --debug pCampbot.exe -loginuri http://192.168.1.2:8002 -s r1 -firstname ima -lastname bot -password plentyofruth
This will start up pCampbot and you'll see a familiar console command line as you would on a simulator or Robust console. As with the other consoles, you can type "help" to get a list of commands.
As of OpenSimulator 0.7.6, pCampbot by default starts without automatically connecting the bots.
Step 3: Connect the bots
Once you're ready, type the command
conn
to start connecting the bots. You will see the connection messages on the console and if all goes well you'll see the bots appear on the region. The default bot behaviour is "physics", so the bots will start walking and jumping around to test and load up region physics.
Step 4: Assess performance
Now this is quite tricky, since there's currently no automated way of assessing simulator or connection performance. Manual ways to assess this include logging in a viewer to the same region to get a feel for avatar movement (e.g. is it jerky, is there rubberbanding, is chat delayed, etc.) and to see viewer statistics such as Ping Sim and Packet Loss.
However, one needs to be extremely carefully if logging in using a viewer on the same machine from which the bots are running. The bots should really be running from a different machine or ideally even from a different network in order to get a more accurate picture of current simulator performance.
One can also look at server side monitoring, particularly "show stats clientstack" which will show various client stack related statistics (this is the part of the OpenSimulator code that handles receiving and sending of UDP messages from viewers). In particular, the InboxPacketsCount should be constantly 0 or near 0 - a build up here means that your simulator is receiving UDP packets quicker than it can process them. Unfortunately, these server-side statistics are still evolving and important measures (such as number of inbound and outbound resends) are still not recorded as of OpenSimulator 0.7.6.
Step 5: Disconnect bots
Once you've finished, you can disconnect the bots in an orderly fashion with the command
disconn
Once all the bots are disconnected you can exit pCampbot with the command
quit
or reconnect the bots if you want. You can also see the current connection status of bots with the command
show bots
at any time.