Tuesday, February 11, 2014

Setting up Federated Search in SharePoint 2013

Setting up Federated Search.

What Exactly is Federated Search? Federated Search was introduced with an infrastructure update in MOSS 2007. Federated Search basically uses the index created by another search engine. It supplies the keyword(s) you enter and gets the result from that Index.

Federated Search only works with indexes compatible with OpenSearch 1.0/1.1 which means that it is compatible with other SharePoint farms, YouTube and Bing to name a some. Federated Search is not compatible with Google.

There are a lot of really excellent blogs on the internet describing Federated Search and how to set it up. Rather than spending time writing how I set up my federated search I direct you to an excellent blog in two parts:

Part 1: http://3sharp.com/blog/build-a-federated-result-source-for-sharepoint-2013-search-part-1/

Part 2: http://3sharp.com/blog/build-a-federated-result-source-for-sharepoint-2013-search-part-2/

Please send comments and suggestions on topics that you would like to see covered in future SharePoint Blogs.

Friday, February 7, 2014

How to measure Page Download Time

 

I am currently at a client who is very unhappy about their SharePoint “speed”. Specifically page render time was very poor. Different users gave different times. When I checked, I found that only the initial page load was slow for the first person. After that, the system performed “fast”. In order to prove this, I wanted to quantify this and establish exactly how bad this was. So here is a small PowerShell  script that measures how long a specific page takes to download and then repeats the test x number of times. This only measures page download time it doesn't include any client side rendering therefore it isn't wholly accurate, but is a good starting point for assessing performance.

The script has two parameters: -URL, which is the URL of the page to download and -Times, which is the number of times to perform the test. The script uses the credentials of the current logged on user to connect to the URL provided.

param($URL, $Times)
$i = 0
While ($i -lt $Times)
{$Request = New-Object System.Net.WebClient
$Request.UseDefaultCredentials = $true
$Start = Get-Date
$PageRequest = $Request.DownloadString($URL)
$TimeTaken = ((Get-Date) - $Start).TotalMilliseconds
$Request.Dispose()
Write-Host Request $i took $TimeTaken ms -ForegroundColor Green
$i ++}

 

How to use the script

Copy the script into a text editor and save it as PageDownloadSpeed.ps1 (You can give it any name you want). Then open Power Shell and run the sctipt .

PS C:\Documents and Settings\anil.ferris> ./PageDownloadSpeed.ps1 -times 10 -url http://CompleteURLisRemoved

 

The first time you run the script you may get an error saying that scripts are disabled on your  system etc., etc., etc. So long as you have admin access on your workstation, run the following command (in Power shell)

PS C:\Documents and Settings\anil.ferris> set-executionpolicy unrestricted

 

Results of my first run

PS C:\Documents and Settings\anil.ferris> ./PageDownloadSpeed.ps1 -times 10 -url http://CompleteURLisRemoved

Request 0 took 47186.292 ms

Request 1 took 515.6118 ms

Request 2 took 203.1198 ms

Request 3 took 156.246 ms

Request 4 took 156.246 ms

Request 5 took 203.1198 ms

Request 6 took 218.7444 ms

Request 7 took 171.8706 ms

Request 8 took 171.8706 ms

Request 9 took 171.8706 ms

PS C:\Documents and Settings\anil.ferris>

 

My Conclusions:

The users were right to complain as you can see the first time the initial page opened it took 47+ seconds. Subsequently it was less than 1 second. The maximum acceptable time for the client is 6 seconds from around the world and 10 seconds from ASPAC.

So we are now playing with warm-up scripts and IIS worker process resets to see how to best minimize the initial page load time and keep the cache fresh.

x-x-x