{"id":2599,"date":"2011-05-23T15:00:00","date_gmt":"2011-05-23T14:00:00","guid":{"rendered":"https:\/\/ingmarverheij.com\/2011\/05\/loadtesting-best-practices-part-1\/"},"modified":"2011-05-23T16:40:35","modified_gmt":"2011-05-23T14:40:35","slug":"loadtesting-best-practices-part-1","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/loadtesting-best-practices-part-1\/","title":{"rendered":"Loadtesting best practices &ndash; Part 1"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/images1.jpg\" alt=\"\" width=\"75\" height=\"112\" align=\"left\" \/>Before I start discussing best practices about loadtesting, let me first tell you what my definition of a <strong>loadtest<\/strong> is.<\/p>\n<div class=\"note\"><em>\u201cTesting a system with representative load, to determine if the nominal load can be handled\u201d.<\/em><\/div>\n<p>This means that if you start loadtesting you need to know the nominal load and have an expectation of the outcome. You will find that most of the best practices has to do with preparation, not with fancy techniques. An different type of test that is frequently called a loadtest, is a stresstest. A stresstest has a different purpose, as can be read in my definition of a <strong>stresstest<\/strong>.<\/p>\n<div class=\"note\"><em>\u201cTesting a system above its nominal load, with the purpose of determining if the system in the future can handle a bigger load and to find a bottleneck.\u201d<\/em><\/div>\n<p>LoadTest are commonly used to scale an environment. These environments can be a SBC environment like Citrix XenApp or Microsoft RDS, or a VDI environment. But other environments like file, print or webservers can be loadtested aswell. In fact, if you can create the load by simulating user actions, you probably can perform some sort of loadtest.<\/p>\n<p>Now let\u2019s start with the best practices. I\u2019ve written these down in the past years while<em> <\/em>I was performing loadtests with the <a href=\"https:\/\/www.denamik.com\/\"><strong>DeNamiK LoadGen<\/strong><\/a>, the best practices apply to (almost) all loadtesting applications. You can say I learned it the hard way. Although there\u2019s nothing wrong with that, you can learn from my mistakes.<\/p>\n<p>This is the first\u00a0 part, focussing on the \u201cbasics\u201d. Part two will focus on more advanced topics.<\/p>\n<p>&nbsp;<\/p>\n<p><!--more--><\/p>\n<h5>1 \u2013 Determine the purpose of the test<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/why11.jpg\" alt=\"\" width=\"75\" height=\"93\" align=\"left\" \/>Before doing anything, you should determine why you\u2019re performing a test. What <strong>type of test<\/strong> are you planning, a load or a stresstest? Do you want to validate a certain result with a pre-defined load, or do you want to find the level where things start to stop functioning properly?<\/p>\n<p>For each test you should know <strong>how much <\/strong>sessions (or users) you\u2019re going to use to simulate the load. 10, 25, 100 or more? The more users, the bigger the impact on the environment and the preparations.<\/p>\n<p>The moment a session is launched, load is generated. Determine the <strong>when<\/strong> and <strong>how much <\/strong>sessions you want to launch <strong>simultaneously.<\/strong> The number of simultaneous users and the interval determines the load on the target environment, if you\u2019re purpose isn\u2019t to stress the environment you should take it slow. If you\u2019re testing a real-life scenario, determine a scenario that corresponds with real life.<\/p>\n<p>Create different <strong>load profiles<\/strong>. Users can generally be placed in different profiles like \u2018light users\u2019, \u2018medium users\u2019 and \u2018heavy users\u2019. Each profile has a different set of applications, workspeed and\u00a0 distribution.<\/p>\n<p>For all of the above the same rule applies: <span style=\"text-decoration: underline;\">consult the customer and adapt the real life parameters as much as possible.<\/span><\/p>\n<p><span style=\"text-decoration: underline;\"> <\/span><\/p>\n<h5>2- Create a scenario<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/stappenplan-200x2001.jpg\" alt=\"\" width=\"75\" height=\"76\" align=\"left\" \/>After a sessions is launched, load needs to be generated by simulating user actions. The user actions simulated should be determined before creating the script that simulates the actions.<\/p>\n<p>The user actions simulated should be written down in a <strong>scenario <\/strong>which describes a roadmap. The scenario described what applications are used and what actions are executed in that application. For each action the expected outcome, a result on the screen, is written down aswell. A good objective to pursue is that a regular user, with no experience with the application, can execute the same actions without asking what to do next.<\/p>\n<p>This way the guy that makes the script that simulates user actions won\u2019t have to know the application.<\/p>\n<p>The best scenario is a scenario that matches the workload of the customer. So consult the customer what applications are used and how the applications are used. Not all applications should be simulated, but it should correspond with the regular workload.<\/p>\n<p>&nbsp;<\/p>\n<h5>3 \u2013 Test users<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/CrashTestDummy1.jpg\" alt=\"\" width=\"75\" height=\"56\" align=\"left\" \/>Sessions require users to authenticate. It is recommended to use dedicated <strong>test users<\/strong> placed in a group. This way the users can be managed easily.<\/p>\n<p>Make sure the users exist, are configured and function before you start. If the users do not exist, and you\u2019re in charge of creating them, make sure you have an administrative account. And, know how and where to create the users, what properties needs to be set and where is the profile and home directory stored?<\/p>\n<p>Test users should all be <strong>equal<\/strong>. Since you\u2019re creating an automated test with simulated user actions, you want them to be as much equal as possible.<\/p>\n<p>&nbsp;<\/p>\n<h5>4 \u2013 SUT<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/imagesCAWUKOVM1.jpg\" alt=\"\" width=\"75\" height=\"59\" align=\"left\" \/>Usually a test is conducted in an environment which has more than one system involved. Determine all <strong>systems <\/strong>that are <strong>under test (SUT)<\/strong> and therefore can influence the result or should be monitored.<\/p>\n<p>Each system that has a connection, and has influence on the end-result, is a system under test. For instance an Active Directory Domain Controller, Fileserver, SQL server, SAN or router. Altough your main purpose can be very simple, like testing a Citrix XenApp farm, each component in the chain can influence the test results.<\/p>\n<p>Windows machines can be monitored using performance counters, the following performance metrics give a good overview of the system. In case a bottleneck is reached, add more performance counters to gain more insight.<\/p>\n<pre>\r\nMemory\r\n     Available MBytes\r\n     Committed Bytes\r\n     Free System Page\u00a0 Table Entries\r\n     Page Faults\/sec\r\n     Pool Nonpaged Bytes\r\n     Pool Paged Bytes\r\n\r\nNetwork Interface\r\n     Bytes Received\/Sec\r\n     Bytes Sent\/sec\r\n     Bytes Total\/sec\r\n\r\nPhysical Disk\r\n     _Total\\% Disk Time\r\n     _Total\\Current Disk Queue Lenght\r\n\r\nPaging File\r\n     _Total\\%Usage\r\n\r\nProcess\r\n     _Total\\Page File Bytes\r\n\r\nProcessor\r\n     _Total\\% Interrupt Time\r\n     _Total\\% Processor Time\r\n     _Total\\Interrups\/sec\r\n\r\nServer\r\n     Server Sessions\r\n\r\nSystem\r\n     Context Switches\/sec\r\n     Processor Queue Lenght\r\n\r\nTerminal Services\r\n     Active Sessions\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h5>5 \u2013 Influences<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/untitled1.png\" alt=\"\" width=\"75\" height=\"64\" align=\"left\" \/>During a test <strong>other processes <\/strong>might be active that can <strong>influence <\/strong>you\u2019re test results. That\u2019s fine if this is part of your plan, but not if you didn\u2019t knew. For instance when a back-up process starts during a test, that might influence the speed of the environment.<\/p>\n<p>Map the activities in the environment and communicate with the customer. If nobody knows they should influence the test, they might do.<\/p>\n<p>Except for a back-up process you might consider processes that influence the fileserver, databaseserver, SAN, WAN connection etc. etc.<\/p>\n<p>&nbsp;<\/p>\n<h5>6 \u2013 Computational vs perceived performance<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/imagesCAGE9ADO1.jpg\" alt=\"\" width=\"75\" height=\"103\" align=\"left\" \/>Looking at the performance of a machine can be done in different ways. Generally these can be divided in two categories: Computational performance and perceived performance.<\/p>\n<p>Computational performance is based on CPU cycles, available memory, IOPS, network throughput etc. Although these are all valid performance indicators, they are nothing more than an indicator. They describe the performance they theoretically should provide. For example if a workload on a processor is 30%, is that good? Or is it inefficient?<\/p>\n<p>Tim Mangan described computational performance in his white paper \u201cPerceived Performance\u201d in September 2003:<\/p>\n<div class=\"note\"><em>\u201cComputational capacity is the total amount of useful work that can be accomplished on a system in a given fixed period of time\u201d<\/em><\/div>\n<p>Perceived performance is from a different angle, the way users perceive the performance. This the end-result of the complete chain and should IMHO be on the top of your list. Perceived performance can be determined by measuring the responsetimes of user actions.<\/p>\n<p>Tim Mangan descbied perceived performance in his white paper \u201cPerceived Performance \u2013 Welcome to VDI\u201d in May 2011:<\/p>\n<div class=\"note\"><em>\u201cA methodology where one analyzes the system with a goal of improving user productivity by focusing on issues that affect the performance as perceived by the users\u201d<\/em><\/div>\n<p>&nbsp;<\/p>\n<h5>7 \u2013 Creating bottlenecks<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 5px 0px 0px; display: inline; float: left;\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/05\/bottle1.jpg\" alt=\"\" width=\"75\" height=\"38\" align=\"left\" \/>Make sure you\u2019re not creating a <strong>bottleneck<\/strong> with your test environment since this influences the outcome. For instance the the machines that hosts the sessions, the LoadBot \/ Loader. Make sure that the number of sessions hosted per machine does not exceed the capacity of the machine. Altough it might sound logical, i\u2019ve seen many cases where the number of sessions on one machine was much more than it can handle. This resulted in higher measurements, even when the target environment had enough capacity.<\/p>\n<p>The same applies for collecting performance metrics. Each performance metric that is collected requires bandwith, if the monitored system is on a slow WAN connection this might influence the test. I\u2019ve seen a test where the complete WAN connection was required for collecting performance metrics leaving no bandwith for the sessions.<\/p>\n<p>&nbsp;<\/p>\n<p>Before you start a test, scale the LoadBots and determine the required bandwith for collection performance metrics.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Ingmar Verheij<\/p>","protected":false},"excerpt":{"rendered":"<p>Before I start discussing best practices about loadtesting, let me first tell you what my definition of a loadtest is. \u201cTesting a system with representative load, to determine if the nominal load can be handled\u201d. This means that if you start loadtesting you need to know the nominal load and have an expectation of the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[302],"tags":[318,316,317],"class_list":["post-2599","post","type-post","status-publish","format-standard","hentry","category-performance-testing","tag-best-practice","tag-loadtest","tag-stresstest"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/2599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=2599"}],"version-history":[{"count":24,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/2599\/revisions"}],"predecessor-version":[{"id":2601,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/2599\/revisions\/2601"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=2599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=2599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=2599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}