PCampBot

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Step 2: Start pCampbot)
m (Example)
Line 61: Line 61:
 
  ima bot_4
 
  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.
+
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 ( dead link ) 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 ===
 
=== 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
+
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 <nowiki>http://192.168.1.2:8002</nowiki>.  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
+
  mono --debug pCampBot.exe -loginuri <nowiki>http://192.168.1.2:8002</nowiki> -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.
 
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.

Revision as of 03:37, 24 September 2021

Contents

Using 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.

Because pCampbot connects bots using the libopenmetaverse library in the same manner that an ordinary viewer program would connect, you can use the pCampbot in 0.7.6 or later to test earlier versions of OpenSimulator.

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" at 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.

Caveats

  • A pCampBot synthetic bot load is still an extremely poor proxy for a 'real' connection (i.e. a real human being logging in with a viewer and doing all the things they expect to be able to do in a virtual world). Real connections are very likely to place different stresses on the simulator so real-world performance may be considerably different and poorer than synthetic load tests would suggest.
  • There are some things you can do to improve this in pCampbot. For instance, if you have RequestObjectTextures set in pCampbot.ini then pCampbot will request textures for all objects it sees. This is both much less stressful than a real scenario (since for a particular sets of bots textures are only requested once) and more stressful (since there is never any caching).
  • pCampbot does currently not work well if there are any surrounding regions. Avatars will currently just walk off into oblivion. You must either build fences or remove such regions. In testing so far, the presence of neighbouring regions does not have any great impact on performance in the region occupied by bots. However, these tests were performed with blank surrounding regions - surrounding regions containing objects will place more initial stress on the bot connections as object data is downloaded (and textures if this option is active).

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 ( dead link ) 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.

A client connection is a complicated affair so you'll probably see many warnings and debug messages of different severity on the console. But as long as the bot it present in the region you can assume that the connection has succeeded.

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, Packet Loss, Physics Time (frame) and Spare Time (frame).

However, one needs to be extremely careful 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.

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.

Personal tools
General
About This Wiki