Blog #6 in How I Successfully Upgraded eBay to SharePoint 2010 – See Previous Blog In Series
One of the requirements of our upgrade was that the upgraded system would perform better than the current 2007 production environment. This included the latency to Europe and other non-US countries. Their are many options that one would have to do this, these include the following:
- Increased bandwidth
- Decrease latency
- Page Weight
- Caching (Server, F5, Proxy, CDN)
In our case, bandwidth was not an issue. In your circumstances, that may or may not be the case. If you have a small pipe, you won't be able to get too many requests going through it. In the end, this really isn't a big deal.
SUPER SUPER important. Latency is the time is takes for the html packets to get to the client. If you have high latencies, your users are going to hate your intranet/SharePoint and call it slow. Even though you spent millions on hardware and it is able to generate the HTML faster than any other system, it can't get it to them fast enough.
Decrease Page Weight:
If you were to fire up Fiddler and watch the typcial traffic flow for a request to SharePoint 2010. You will see several requests are being made to the server. Because there is an order to the madness, their is a multiplier effect to the time it will take for a user to fully load a page (even with async requests occuring). YOUR NUMBER ONE GOAL IS TO MINIMIZE THE HTTP REQUESTS FOR A PAGE. How do you do this? You can do this in several ways:
Evalute Picture Usage
The CSS classes between 2007 and 2010 changed A LOT! If you had custom CSS that overrode the out of the box CSS, it very likely will not have any effect in 2010. It should go without saying….you should remove this CSS. You should also attempt to determine how many different CSS files you have being downloaded from your pages. If you can consolidate those into one CSS, then you are going to be in a very good position moving foward. Steps:
Find all CSS classes used in your pages
Evaluate if they can be combined into one CSS file
Determine what CSS is used
Remove un-used CSS from your CSS files
Compress the CSS (remove all white space)
How does one find out is CSS is used or not? Here's the steps:
Get all your CSS classes used in your CSS files
Export all ASPX files from SharePoint to the SharePoint Root
Run a search on all the files for each CSS
Any CSS that is not found can be deleted
1. How does one export all the CSS? Heres a handy script:
$templateDir = "c:program filescommon filesmicrosoft sharedweb server extensions14 emplate"
del "$templateDirASPX" -recurse -force
#export all aspx files to temp directory
$cdbs = get-spcontentdatabase
$count = 0
foreach($cdb in $cdbs)
"Processing " + $cdb.Name
$conn = new-object system.data.sqlclient.sqlconnection $cdb.legacydatabaseconnectionstring.replace("Timeout=15","")
$cmd = $conn.CreateCommand()
$cmd.CommandTimeout = 4000
$cmd.commandtext = "select dirname, leafname, content from alldocs ad, alldocstreams ads where ad.Id = ads.id and ads.id in (select id from alldocs ad where extensionforfile in ('aspx')) and ad.internalversion = ads.InternalVersion";
$reader = $cmd.executereader()
$filename = $reader["leafname"].replace("/","_")
$fileContent = $reader["content"]
$dirname = $reader["dirname"]
$temp = $count.tostring() + "`t" + $cdb.Name +"`t" + $dirname +"`t" + $filename
add-content "Files_ASPX.txt" $temp
[System.IO.File]::Writeallbytes($templateDir + "ASPX" + $count.tostring() + "_" + $filename, $fileContent)
2. How does one search for the CSS? Here's another handy script (note it will take a while for this to finish):
$classes = get-content "Css.txt"
cd "c:program filescommon filesmicrosoft sharedweb server extensions14"
foreach($_ in $classes)
dir -r -i *.aspx | select-string $_ | select filename, linenumber >> $_.txt
dir -r -i *.ascx | select-string $_ | select filename, linenumber >> $_.txt
dir -r -i *.css | select-string $_ | select filename, linenumber >> $_.txt
3. Create a list of all the CSS classes used in your CSS,
4. Compare the output of the last script and your CSS list, determine what is not used. I'll leave it to you to write the script for that. Just use a hashtable 🙂
5. Compress your CSS, tools for that:
Tools to Minify are here:
Evaluate Picture Usage:
Does your site have a lot of pictures? Doesn't look like SharePoint anymore? That's both a good and bad thing. The more pictures you have, the large the page weight. Here's what you can do to decrease the page weight:
Ensure that buffer images are width 1 and heigth 1 – I can't tell you how many times I have seen an image created that is 10K and is used as a buffer image. It only needs to be a few bytes and a 1×1 image!!!
Use sprites – make lots of small images into one to reduce your HTTP requests
There are lots of ways to do caching. And there is a ranking of most benefical and easy caching methods…here they are:
Content Delivery Network (CDN)
F5 Load Balancer
Content Delivery Network (CDN) – very similar to the Proxy server in that it keeps a local copy of the content, but you have to factor that into your web page design/HTML. I'm not a fan from an easy of manageability standpoint, but it would match the proxy server in the performance increase you would see.
Hardware Compression – By deploying devices on your network edges, you can compress the WAN traffic. This tends to be a very costly solution and requires a lot of testing. In larger organizations, good luck with getting the network guys to mess with anything sitting next to the routers!
In the end, we were able to increase the visible and technical user performance for Eurpoean users by over 30%. They have made alot of comments of how much faster it is, even if their are weird quirks with the sites, they are still amazed at how fast it is! Chalk one up for the CJG-mister!
See the next blog post in this series HERE