Load Test from the Cloud

By: Scott Gillis, Lead Consultant – When building any application, but especially high traffic websites, on Sitecore, one of the final steps before launch is to ensure any caching mechanisms have been properly tuned to support the needs of the organization.

One of the difficulties my teams always have is finding a server or two (or three) with enough available horsepower to pound on our site. Running from a simple local machine is good enough for about 2 minutes until it begins heating the entire office. To keep from badgering the system admins for more horsepower and a desire to maintain a more comfortable office setting, I had to look elsewhere. My search sent me the cloud course… Visual Studio Team Services to be specific. By the way, it's free to register and take advantage of even.

Visual Studio Team Services (VSTS) provides a number of different tools and services, many of which are free such as GIT repos, CI, team and task management. One of the services provided is the ability to run scaled load testing from the cloud. Depending on your needs, you have the opportunity to run four types of tests from VSTS: Visual Studio Test, HTTP Archive Based Test, URL Based Test, or Apache jMeter Test.

Load Test Options Image

Two things I found great about the service are, A) I get a decent number of free testing units (called Virtual User Minutes) to perform my testing, and B) I don't have to purchase a high level MSDN or Visual Studio license. Why? Because it supports my tool of choice Apache's jMeter.

As easy as 1, 2, 3

I can build and even pre-test my jMeter test scenarios on my local or internal hardware to confirm it generates the proper simulated traffic. After this, it is as easy as 1,2,3,4..and maybe a 5th step.

  1. Login to Visual Studio Online
  2. Click over to the Load Test screen
  3. Create a new test of type jMeter from the selector
  4. Upload the jmx file representing your developed jMeter scenario
  5. Steps 2 to 4 Image
  6. Upload your jmx file that defines your test run. Note that the name of the file is the name the test will be referenced as in the other screens.
  7. Set your number of agents, length of run, and region the test should run from.
  8. Click Run
  9. Steps 5 to 7 Image
  10. Smile and sip your coffee as the data pours into convenient charts and table.

Not Accessible to the World, yet?

If your site is sitting behind a firewall and only has internal DNS, with some additional setup, you can still leverage the power of the cloud to perform your test, Testing private/intranet applications using Cloud-based load testing.

Load Testing Sitecore

For load testing Sitecore, check-out this pre-configured jMeter test provided by Sitecore themselves https://kb.sitecore.net/articles/398589. One thing to note is, if you would also like to test out or populate xAnalytics data, you will want to disable robots detection using the following patch config. Robots detection needs to be disabled so that the tester does not trigger page events as required by xAnalytics for identifying a 'human' user. (Just be sure to turn it back on before site launch.)

        Ignore requests and do not write information to the Analytics database when the visitor
        classification identifies the visitor as a robot.
        Default: true
    <setting name="Analytics.Robots.IgnoreRobots">
        <patch:attribute name="value">false</patch:attribute>

If data still isn't properly collecting you may also need to tweak the robot's timeout value to allow the session to run longer.

        The ASP.NET Session Timeout for auto detected robots.
        When the automatic robot detection identifies a session as being a robot, the ASP.NET
        Session Timeout is set to this value (in minutes).
        Default: 1
    <setting name="Analytics.Robots.SessionTimeout">
        <patch:attribute name="value">5</patch:attribute>

Its that simple, and now there is no longer any reason to avoid even basic site load tests for Sitecore or any other application.

During my exploration of leveraging this cloud based load testing, I found the following links to be informative:



Scott Gillis, Lead Consultant at Paragon and 2017 Sitecore MVP, has been working with Sitecore for several years. He has a deep passion for helping clients leverage their content and data into powerful new capabilities in Sitecore and has produced successful outcomes as the technical lead on numerous, complex implementations. Recently, Scott has been focusing on helping these clients take advantage of the wealth of data collected by Sitecore Experience Analytics.