<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.imason.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Boyan's blog : load test</title><link>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/load+test/default.aspx</link><description>Tags: load test</description><dc:language>en</dc:language><generator>Telligent Evolution 5.0 (Build: 40623.6204)</generator><item><title>Visual Studio Test Suite 2008: Unit Tests Pass but Load Tests Fail</title><link>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2010/06/03/visual-studio-test-suite-unit-tests-pass-but-load-tests-fail.aspx</link><pubDate>Thu, 03 Jun 2010 15:53:00 GMT</pubDate><guid isPermaLink="false">ba1d72eb-a51c-4157-8cec-718d26de3334:2244</guid><dc:creator>Boyan Tsolov</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.imason.com/imason_Blogs/b/boyan_tsolov/rsscomments.aspx?WeblogPostID=2244</wfw:commentRss><comments>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2010/06/03/visual-studio-test-suite-unit-tests-pass-but-load-tests-fail.aspx#comments</comments><description>&lt;p&gt;This is a problem I recently ran into:&lt;/p&gt;
&lt;p&gt;- I am using Visual Studio Test Suite 2008 to create load tests that run multiple unit tests&lt;/p&gt;
&lt;p&gt;- I created unit tests that run by getting configuration settings from an app.config file&lt;/p&gt;
&lt;p&gt;- If I run the unit test by itself, they pass&lt;/p&gt;
&lt;p&gt;- I placed the unit tests in a load test and ran that: the load test fails at the line of code that tries to access the app.config:&lt;/p&gt;
&lt;p&gt;if (System.Configuration.ConfigurationManager.AppSettings[&amp;quot;xxx&amp;quot;].Equals(&amp;quot;xxx&amp;quot;))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Fixing this is extremely simple. In fact, this blog post describes it perfectly: &lt;a target="_blank" title="Unit Test succeeds, but Load Test always fails in VSTS 2008" href="http://www.apexa.net/Blog/web_design_Blog_20080602.aspx"&gt;http://www.apexa.net/Blog/web_design_Blog_20080602.aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;View the properties of the load test&amp;#39;s Run Settings and set the property: &amp;quot;Run unit tests in application domain&amp;quot; to TRUE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.imason.com/resized-image.ashx/__size/550x500/__key/CommunityServer.Blogs.Components.WeblogFiles/00.00.00.00.29/6232.UnitTests_5F00_In_5F00_LoadTests.JPG" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Done!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.imason.com/aggbug.aspx?PostID=2244" width="1" height="1"&gt;</description><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/load+test/default.aspx">load test</category><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/technical/default.aspx">technical</category></item><item><title>Performance Testing: The Performance Test Plan</title><link>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2009/11/10/performance-testing-the-basics.aspx</link><pubDate>Wed, 11 Nov 2009 03:57:00 GMT</pubDate><guid isPermaLink="false">ba1d72eb-a51c-4157-8cec-718d26de3334:2208</guid><dc:creator>Boyan Tsolov</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.imason.com/imason_Blogs/b/boyan_tsolov/rsscomments.aspx?WeblogPostID=2208</wfw:commentRss><comments>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2009/11/10/performance-testing-the-basics.aspx#comments</comments><description>&lt;p&gt;I have always had a problem doing performance testing (aka load testing). I am quite adept at recording web tests and collecting counters, but I still find it troublesome interpreting the counters that I gather from load tests. The problem is that I need a plan that will produce relevant results with which I can conclude with confidence: &amp;quot;This system is a juggernaught! It can withstand more hits than Google.com.&amp;quot; If you are like me and you have trouble planning your load tests, then maybe this post will help you. The following post describes how I like to run my own plan and what conclusions I can make with this plan.&lt;/p&gt;
&lt;p&gt;Special thanks goes out to &lt;a target="_blank" href="http://imason.com/imason_Blogs/b/fast_sharepoint_search/default.aspx"&gt;Jeff Dunmall&lt;/a&gt;, our co-CEO, whose article &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/magazine/cc188783.aspx"&gt;&amp;quot;Real-World Load Testing Tips to Avoid Bottlenecks When Your Web App Goes Live&amp;quot;&lt;/a&gt; got me to write something more about load testing here, and Randar Puust who uses this plan (and thus now I use it too).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are a number of facets to load testing:&lt;/p&gt;
&lt;p&gt;- setting up a load testing rig and setting up your environment in&amp;nbsp; Visual Studio&lt;/p&gt;
&lt;p&gt;- recording the web tests &lt;/p&gt;
&lt;p&gt;- planning the load tests&lt;/p&gt;
&lt;p&gt;- collecting performance counters and figuring out what the recorded result mean&lt;/p&gt;
&lt;p&gt;Unless you have a plan, planning the load tests and reading the results will be meaningless. A &lt;b&gt;performance test plan&lt;/b&gt; will keep you on track throughout the last two phases mentioned above. The results from a test plan will allow you to determine:&lt;/p&gt;
&lt;p&gt;- maximum number of users that can hit the site before it becomes unresponsive&lt;/p&gt;
&lt;p&gt;- can the system recover from overload&lt;/p&gt;
&lt;p&gt;- are there memory leaks in the code&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A performance test plan consists of four types of tests that need to be run in the following order:&lt;/p&gt;
&lt;p&gt;1. Performance Tests&lt;/p&gt;
&lt;p&gt;2. Load Tests&lt;/p&gt;
&lt;p&gt;3. Stress Tests&lt;/p&gt;
&lt;p&gt;4. Endurance Tests&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. Performance Tests&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;These are the benchmark tests. By this point you should have recorded web tests which cover the most-used parts of your web application. Now, you will create a load test that gathers and runs all of the web tests that you have recorded. Run the load test with settings similar to these:&lt;/p&gt;
&lt;p&gt;- load: low end of the expected number of users for the system. I like to start with 5 or 10.&lt;/p&gt;
&lt;p&gt;- time: 10 minutes&lt;/p&gt;
&lt;p&gt;- think time: 5 seconds&lt;/p&gt;
&lt;p&gt;- warmup: 30 seconds to 1 minute is more than enough&lt;/p&gt;
&lt;p&gt;A load test like this should not stress the web server, it should be low-impact. The goal of this test is for it to be run later on in this plan and be used to compare against (i.e. a benchmark). Collect and save the result counters from the web server and from the client. Web Server counters to collect are: &amp;quot;CPU %&amp;quot;, &amp;quot;Used Memory&amp;quot;. Client counters to collect are: &amp;quot;Respose time per page&amp;quot;, &amp;quot;Number of Requests per second&amp;quot;. Other counters you might like to save are &amp;quot;pages that take the longest time to load&amp;quot;, &amp;quot;number of errors&amp;quot;, &amp;quot;network usage&amp;quot; - these are useful for neat reports that you might want to compile.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2. Load Tests&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The load tests are going to stress the web application and try and find its breaking point. The goal of these test will be to find the lucky number X. This number is the number of users that are concurrently hitting the system and that cause the system to be unresponsive or response times to be unacceptable. For this part of the plan you will need to run a number of load tests. In each case, increase the number of users and collect the counters:&lt;/p&gt;
&lt;p&gt;- load: 10 users, 15 users, 20 users, 50 users.... until the response times get too large, or server CPU % gets dangerously high.&lt;/p&gt;
&lt;p&gt;- time, think time, warmup: same as for the performance test. Basically we are running the performance test from step 1but with more and more users.&lt;/p&gt;
&lt;p&gt;By the end of this step you will know what is the maximum number of users that can hit the system.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3. Stress Tests&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Stress tests check that the web application can recover from errors induced by overload. &lt;/p&gt;
&lt;p&gt;- load: X + 20% (where X is the magic number from step 2 which causes the system to be unstable)&lt;/p&gt;
&lt;p&gt;- time: 1 minute&lt;/p&gt;
&lt;p&gt;- think time: 5 seconds&lt;/p&gt;
&lt;p&gt;After this test is run the system should become unresponsive. If it is not unresponsive, then increase the 20%. One way to check if it is unresponsive is to check that response times are suddenly exponentially far worse than the results in step 2 and CPU % usage on the server is close to 100%. &lt;/p&gt;
&lt;p&gt;Immediately after this test runs run the performance test from step 1. If the performance test runs fine and the results are comparable to the test that was run at step 1, then your system passes! It can safely recover from overload issues.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4. Endurance Tests&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The endurance tests are unrelated to the other 3 tests. These tests are run over a long period of time, which causes many users to hit the site. If there are memory leaks, then over the course of this endurance test the free memory on the web server should decrease dramatically.&lt;/p&gt;
&lt;p&gt;- load: X - 20% (where X is the magic number from step 2 which causes the system to be unstable). We&amp;#39;ll use -(minus) 20% because we don&amp;#39;t want to overload the system&lt;/p&gt;
&lt;p&gt;- time: 12 hours&lt;/p&gt;
&lt;p&gt;- think time: 5 seconds&lt;/p&gt;
&lt;p&gt;Remember to record the &amp;quot;Free&amp;quot; or &amp;quot;Used Memory&amp;quot; on the web server. The goal at the end of this step is to make sure that the memory usage on the web server has not decreased dramatically and thus there are no memory leaks in your code. If that is the case with your results then tip of the hat to you!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the end of these four types of tests you should have a better idea of where your system stands in terms of load that it can handle. You will know: &lt;/p&gt;
&lt;p&gt;- what is the maximum number of users it can handle before performance is unacceptable&lt;/p&gt;
&lt;p&gt;- can it recover after an overload&lt;/p&gt;
&lt;p&gt;- are there any memory leaks&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Happy testing!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.imason.com/aggbug.aspx?PostID=2208" width="1" height="1"&gt;</description><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/load+test/default.aspx">load test</category><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/technical/default.aspx">technical</category></item><item><title>Setting up a load test database store with Visual Studio Test Edition</title><link>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2008/08/12/setting-up-a-load-test-database-store-with-visual-studio-test-edition.aspx</link><pubDate>Tue, 12 Aug 2008 22:39:00 GMT</pubDate><guid isPermaLink="false">ba1d72eb-a51c-4157-8cec-718d26de3334:88</guid><dc:creator>Boyan Tsolov</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.imason.com/imason_Blogs/b/boyan_tsolov/rsscomments.aspx?WeblogPostID=88</wfw:commentRss><comments>http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/2008/08/12/setting-up-a-load-test-database-store-with-visual-studio-test-edition.aspx#comments</comments><description>&lt;p&gt;When setting up Visual Studio to run load tests you might have noticed a nasty warning message such as this one:&lt;/p&gt;
&lt;p&gt;&amp;quot;The connection string for the database has not been set. To store your results in a database for post-run analysis, set the connections string to a valid load test results store.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.imason.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/boyan_5F00_tsolov/image_5F00_2.png"&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb.png" alt="image" style="border:0pt none;" height="78" width="244" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This happens because Visual Studio is trying to store your test results in a database store. This way you can load it later (in case you close your current open Visual Studio application). This post will show you how you can configure Visual Studio to stop bugging you. &lt;/p&gt;
&lt;p&gt;We will get rid of that message by actually listening to it and configuring a database for Visual Studio to use. You will need access to an SQL database server and access to the Management Studio - you will need to run a SQL Query. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. Open SQL Management Studio&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.imason.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/boyan_5F00_tsolov/image_5F00_4.png"&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb_5F00_1.png" alt="image" style="border:0pt none;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2. Find the SQL Query that will create your database store&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;This file is C:\Program Files\Visual Studio 9\Common7\IDE\loadtestresultsrepository.sql &lt;br /&gt;This is the directory for Visual Studio 2008, but this file should be there for other versions as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.imason.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/boyan_5F00_tsolov/image_5F00_6.png"&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb_5F00_2.png" alt="image" style="border:0pt none;" height="194" width="403" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3. Run the SQL Query file&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Hopefully you will get the &amp;quot;Command(s) completed successfully&amp;quot; message&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.imason.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/boyan_5F00_tsolov/image_5F00_8.png"&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb_5F00_3.png" alt="image" style="border:0pt none;" height="309" width="410" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4. Link Visual Studio to this new database&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;Open Visual Studio.&lt;/p&gt;
&lt;p&gt;Go to Test &amp;gt; Administer Test Controllers...&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb_5F00_5.png" alt="image" style="border:0pt none;" height="191" width="405" /&gt; &lt;/p&gt;
&lt;p&gt;And enter in the LoadTest database name in the dialog that appears&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.imason.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/boyan_5F00_tsolov/image_5F00_14.png"&gt;&lt;img src="http://www.imason.com/img/blogs/image_5F00_thumb_5F00_6.png" alt="image" style="border:0pt none;" height="403" width="272" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Et Voila! No more error message!&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.imason.com/aggbug.aspx?PostID=88" width="1" height="1"&gt;</description><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/load+test/default.aspx">load test</category><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.imason.com/imason_Blogs/b/boyan_tsolov/archive/tags/technical/default.aspx">technical</category></item></channel></rss>