Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Sunday, April 15, 2012

More Lessons learned from Performance Testing SharePoint

Performance testing with SharePoint, or any web based application, can be quite tricky.  Recently my team launched an upgraded Corporate Web Site based on SharePoint 2007.  The launch was quite challenging mainly due to mistakes made during performance testing Lessons Learned from Intranet Launch.

This post is dedicated to the lessons learned from the performance testing of Corporate Web Site. 

Prior to launch we ran through our performance test scenarios 3 times.  Each time the output showed that we could scale way beyond the existing implantation of our Corporate Web Site (Referred to as Violin from here on). 

The performance test scenarios had been chosen based on traffic patterns and pages determined to be high risk for performance (This was good). 

Our key performance requirements stated that the web servers must support 38 page views / sec with response time < 5 sec (This was good).  This is a nice well defined requirement, although some could argue that 38 page views needs to be broken down into specific types of pages (ex. 10 home page views, 7 chapter page views, …). 

We also had a performance goal stating that processor utilization should not go above 80% on web servers for more than 5 seconds (This was good).

For the final test we replayed traffic from IIS logs that were taken during peak traffic window (when we received the most requests / sec).  This was a bit tricky because my Load Runner resource told me that this was not supported by Load Runner.  So he and I had to message the data inside the IIS logs to get it so Load Runner would support running the tests (this felt wrong at the time, but I cannot say if it is a mistake).

We used Load Runner (sorry I do not know version) for all of the performance tests.  The Load Runner clients were located within the same data center as our web servers, but they were on different network segments.

When we ran the tests we engaged several people from operations team (Network, Windows Server, SQL Server DBA and SharePoint Admin).  These people were tasked with monitoring components related to their area of expertise.  They were also required to collect performance statistics and report those back so they could be included in overall performance test report (This was good).

So each time we ran the tests we were able to reach levels of about 90 page views / sec on one server with avg. response time < 5 seconds (we have 4 load balanced WFE in our farm).  So we were hi-fiving and slapping each other on the back.  As far as we were concerned performance requirements were met, check them off we are done.

We did notice an occasional spike w/ CPU, but we were able to correlate this back to pages expiring in Output Cache.  So this was not a concern.

Well once we went live we discovered that something was gravely wrong.

After going live we discovered that the output cache hit ratio was not aligned with the numbers we were seeing during performance testing.  So were were having a LOT less output cache hits.  This resulted in the servers having to do a lot more work than originally anticipated.

What could have happened? We thought we did everything right with the performance tests.  What went wrong?

Well after much soul searching (and re-reading basics of performance testing) it hit me.  "

Oh $hit we didn’t model user variations and think times. 

Yeah it does, the reason is because we ran a high number of requests but the proportion of cached requests vs. un-cached requests was out of balance.  Had we have taken into consideration user think times and other variations(browser type, user location) we would have less hits against output cache.

Classic 101 Performance Testing Mistake.  Oh well, you pick yourself up, dust yourself off and vow not to make the same mistake again.

User think times are critical when doing performance testing (especially for web applications that rely on ASP.Net Output Caching to meet performance goals).

Just as important as think times you need to look at the IIS Logs (or your web analytics reports) to understand browser differences and local differences.  This is extremely critical if you have Output Cache configured so it treats these differences as non cached page requests.

While this is not as important as Think Times and End User variations it is important if you are doing performance testing through a load balancer configured with session affinity. 

All of the tests we ran looked like they were coming from 2 IPs.  While I cannot prove this invalidated the test results it looks like there was some sort of caching efficiencies realized somewhere in the stack (Switch, NIC, IIS, …). 

References

Microsoft Patterns and Practices: Performance Testing Guidance for Web Applications

Microsoft Office Server Online: Configure page output cache settings

MSDN: Output Caching and Cache Profiles


View the original article here

Load Testing SharePoint (Lessons Learned) (Part 2)

In part 1 I discussed the setup of my load testing environment and tests.  In part 2 I want to focus on the tests runs and what configuration I had to make to get them to work.

Bottlenecks oh Bottlenecks, wherefore art thou Bottlenecks

Right out of the gate I ran into trouble.  My tests showed a bottleneck at 4 requests per second.  The CPU was running @ 25 - 35% no matter what user load VSTS used (remember I was using goal based testing that would keep loading users until the goal was met).  I tried several different tests and they all had the same result.  So I knew there was a bottleneck somewhere.

I started by looking at the network.  Specifically I focused on the virtual's network adaptor.  I was worried that there was some sort of VMWare configuration problem.  To test the network I used a file copy test (I uploaded and downloaded a large file to the web server).  The test showed that the network was working just fine.

Then it hit me, the web server was configured to only support Integrated Windows authentication (NTLM).  So I configured SharePoint (and IIS) to support Anonymous authentication.  Bam, the bottleneck was gone.

Size Matters

So I ran my first set of tests.  Unfortunately I noted a fairly significant difference between the out of the box Article page and our custom page.

Next I used the SharePoint Test Data Population Tool to create a site collection that contained 22,000 sites and about 50,000 pages.

Then I ran the tests again with some very surprising results.  The out of the box Article page when from 114 requests per second to 56 requests per second.  That's right we recorded an almost 100% decrease in performance just due to the size of the site collection. 

Our custom page's did not experience the same percentage of slow down (actually their performance improved, but that was due to improvements we made to the code).

Summing Up

Performance testing SharePoint is a tedious but necessary task.  Here are my lessons learned from the exercise.

1. Plan, Plan, Plan

Establish the test goals

Determine which tests you need to run

Determine which tools you will use

Determine the setup/configuration of your SharePoint and Load test environments.

2. Dry run the tests (leave plenty of time to work through issues)

3. Don't test with an empty site collection


View the original article here