BrowserHawk - Connection Speed and Latency Testing


Index:

 - Background
 - Introducing the new, "Progressive" connection speed and latency tests
 - Configuration, usage, and samples
 - Using the Progressive speed check may increase your web hosting charges

______________________________________________________________________________

BACKGROUND


The BrowserHawk ConnectionSpeed and ConnectionLatency properties measure your
user's download connection speed in bits per second and their latency in
milliseconds. 

In BH versions prior to 12.0, the ConnectionSpeed test inserted data directly
into the HTML source as a means of measurement, and testing the connection
latency was not possible.

Although this approach typically provided an acceptable level of accuracy, a
higher level of accuracy and repeatability, faster testing times, more
grainular control over the testing, and latency measurements were highly
desired by customers.


______________________________________________________________________________

INTRODUCING THE NEW, "PROGRESSIVE" CONNECTION SPEED AND LATENCY TESTS


Starting in BH 12.0 we introduced an option to enable a new, robust approach
to measuring connection speeds and latency. This approach is known as
"Progressive" connection speed testing.

The Progressive connection speed test first performs a very fast speed check
to get a rough feel for the user's connection speed and latency.  Based on
this data, BH then performs a more robust, finely controled speed check using
an amount of data appropriate for the user's connection.  This results in a
very high level of accuracy, with testing times that are optimized for each
user's connection speed and quality.


______________________________________________________________________________

CONFIGURATION, USAGE, AND SAMPLES

To use Progressive testing there is a zip to download at
http://www.cyscape.com/download/speed-supportfiles.zip.

The image files contained in this zip must be placed on your web server in a
publicly accessible location. These files are used by the Progressive
ConnectionSpeed and ConnectionLatency tests.  You must also set a
configuration option within BH to indicate where you placed these files. This
is done using the SupportFilesRoot property, and must be done prior to calling
the line of BH code which executes the extended property check.

Details:


  STEP 1: Extract image files

  Copy all the .gif and .jpg files contained in this zip to your web server in
  a subdirectory that is publicly accessible. We recommend that you create a
  subdirectory called "bhspeed", located directly off your root web directory,
  and copy the image files to this location.

  For example, assume your web site root directory is located in c:\mysite.
  In this case you would create a subdirectory called "bhspeed" which would
  reside underneath "mysite" (c:\mysite\bhspeed) and copy all the image files to
  this location.  Permissions should be set so that the public web site
  user/group has at least READ permissions to these files.

  Note: These image files are for transparent data transfer only. The contents
  of these files are not displayed to your site visitors.

  Note: You may wish to locate these files on a web server seperate from where
  your main site content is located. For example, on a CDN. However it is
  important to note that the speed measurement is performed between the user's
  browser and the web server where the images are stored. This may weigh into
  your decision on where to store the files if more than one web server or
  network is an option.


  STEP 2: Tell BH where you placed the image files

  Before calling the extended property check, you must tell BH what the
  location is of your image file.  This location can be an absolute or relative
  path to the subdirectory you created in Step 1. Note that this is a web path,
  as seen by the browser (not a file system path as seen by the web server). For
  example, in the above scenario the path would be "/bhspeed".

  For BJ4J, use this syntax (assumes you created the ExtendedOptions class
  as "options"):
    options.setSupportFilesRoot("/bhspeed");


  STEP 3: Verify your path setting is correct

  Next you should verify that the path setting is correct and that the files
  are in the right location and accessible to the browser.  To do this, open
  your browser and try to directly access one of the image files. To do this,
  you should construct a URL using your web site name, the path set in Step 2,
  and one of the image file names, such as img10.gif.  For example,

    http://www.mydomain.com/bhspeed/img10.gif

  When entering your URL you should see the image displayed in the browser.
  If so, the verification is complete. If not, double check your work from steps
  1 and 2.


  STEP 4: Enable the Progressive speed check option

  To ensure backward compatibility for customers upgrading to BH 12 who have
  not yet set these options, BrowserHawk defaults to using the old-style
  ConnectionSpeed test.  To have BH use the Progressive speed test, you must set
  the SpeedCheckType property to indicate a Progressive speed test is desired.

  Use this syntax:
    options.setSpeedCheckType(ExtendedOptions.SPEED_CHECK_TYPE_PROGRESSIVE);


  STEP 5: Progressive speed check samples

  The above steps provide instructions for how to configure the Progressive
  speed checks and the mandatory related options which must also be set in your
  code.  For a full working sample which demonstrates the Progressive speed
  check in action, including the other necessary code such as what is required
  to perform extended property checks in general, please see the speed.jsp
  sample.
  

______________________________________________________________________________

USING THE PROGRESSIVE SPEED CHECK MAY INCREASE YOUR WEB HOSTING CHARGES

Important notice: Using the Progressive ConnectionSpeed and or
ConnectionLatency tests will result in increased data transfer (download)
usage between your web server and your visitors.  If the amount of data
transfer your web site uses impacts your hosting charges, then using the
Progressive speed check may indeed result in higher charges from your hosting
provider. Such charges may be significant.

Each time a Progressive speed check is performed, BrowserHawk dynamically
selects one of the image files you placed in your web site in step 1 and
transparently transfers it from your site to the user.  These image files
range from just a few KB up to 5MB.  Users on the faster, higher quality
connections will typically transfer the image files toward the higher end,
resulting in 3-5MB of transfer for each test.  Users with slower, lower
quality connections will typically transfer the smaller image files, resulting
in 128KB - 2MB of transfer for each test.

For busy sites, this amount of data transfer can add up quickly.  For example,
assume a busy site has 100,000 visitors per day. Further assume that 30% have
high quality connections and average 4MB of transfer per test, 45% have medium
quality connections and average 2MB of transfer per test, and 25% have low
quality connections and average 1MB of transfer per test. Assuming each user
has their speed tested once per day, this works out to 120GB, 90 GB, and 25 GB
per day respectively, for a total of 235 GB per day, or 7 TB per month.  Such
volumes of data transfer may add significantly to your web hosting bill. If
you have any doubts be sure to check with your service provider to determine
how an increase in data transfer may impact your bill.

If you wish to lower the amount of data transfer used by the Progressive
connection speed test, one option is to use the SpeedCheckMaxBpsCutoff
setting.  If a preliminary speed test measures a speed above this bps value,
there will be no later larger test to improve the accuracy.  Instead, that
first tested value will be returned.  If accuracy isn't required for
high-speed connections, this setting can help reduce the amount of data
transfer.

You can also try setting the SpeedCheckTestSeconds to 1 (default is 2) which
should result in BH using smaller image files than the ideal in order to
perform the tests faster. Note however that in doing so you will sacrifice
some degree of measurement accuracy.  Another option is to use the
original-style ConnectionSpeed test (do not set up the Progressive option)
which only uses about 50KB of data per test, regardless of the user's
connection quality.

If you have any questions, please see our Knowledgebase at www.cyscape.com/kb
or contact us at support@cyscape.com

Copyright (c) 2010 cyScape, Inc. All rights reserved.
