It’s been a while since I posted (this feels like a confession) and for that I’m sorry. In-between the NBA finals, my new job and all and all, things have been radical so unfortunately my beloved blog has taken a little bit of a back seat.
“TO INFINITY AND BEYOND!!!”
That quote is somewhat relevant in my head as I’m refocusing on getting articles on bi-monthly or at least every 3 weeks. Enough of the #demotivational, let’s get into this latest article.
While deploying a large infrastructure project one of our last requirements was to test performance on the “naked” instances before anything is deployed to it. This will give the client a great baseline off of which to work when new projects are added including future the ability to benchmark performance and capacity.
For those that haven’t been exposed to using VS2010 for performance testing, have a look at this great article that outlines most of the theory. (Testing Application Performance and Stress)
On a high level, the administrator creates a number of web tests and then packages them together in one load testing scenario. Configures the time, load, user step up, browser version balance and more. The test is then executed and the administrator can review the results in real-time and store them for later.
As with most things IT, it’s never as easy as what it seems and while going through this process I worked through a couple of “gotchas” which I’d like to share below.
To get the groovy performance testing running you will lead Visual Studio Ultimate, but waits there is more. Not only will you need this license, you will also require certain user packs. Herewith a screenshot that describes the two options:
Note: Herewith a link to a very cool article with FAQs about the Visual Studio 2010 performance testing – Visual Studio 2010 Feature Packs Frequently Asked Questions
So basically, what is noted above is the difference between running tests with unlimited users, versus running it with a maximum of 250 virtual users. For obvious reasons, organizations with more than 250 potential users will need the unlimited options. Other organizations that would like to benchmark their environments to the point of failure will also for sure need the unlimited pack.
Storing Test Results
As part of the performance testing elements, a database is used to store all results and so forth. Now this is all fine and dandy, but consider the scenario whereby the database doesn’t exist and you want to get cracking with the testing (Yip, this is what I ran into). Herewith a quick couple of steps to get it sorted:
- You can review the connection string settings by clicking on the test control manager. If the database in the connection string no longer exists is isn’t functional, you will need to create another one.
- To create a new performance testing database, execute the following SQLCMD on the SQL box – (ensure you are in the correct folder) – SQLCMD /S localhost\sqlexpress /i loadtestresultsrepository.sql
- Once the DB is created, go back to the connection string settings and update the string with the relevant details.
Fore more in depth elements on the data store creation, navigate to this link – How to: Create a Load Test Results Repository Using SQL
Oh yes, our friend, Mr. Administrator or Mr. Unauthorized. For security it is super important to understand the nuances of internet explorer zones, security levels, user access control and sessions.
For example, when you create a new web test (which forms part of a load test) Internet Explorer will open and all your clicks will be recorded. If you are not operating in a trusted zone / intranet zone, you will be prompted to authenticate. In that case, you need to edit the security context of the web test and “bind” the users to the actual web test. This works great for cross domain testing, but I would steer clear from this if at all possible.
The other key element to consider is your connection string that is more than likely running in a windows authenticated mode. This means that as you load test starts, the identity that is running Visual Studio (and more than likely logged onto Windows) needs access to write to the performance database created in the above mentioned step.