SharePoint 2013 Search Center URL update in All Site Collections

When we plan to use a new search center in SharePoint 2013 for a web application, the question arises how to update the site collections with this new Search Center URL and PowerShell seemed the best option and while iterating through all the site collections to update Search Center URL. Make sure the search settings under subsites/webs “Use the same results page setting as my parent” is checked. Then updating the search center url at Site Collection level should work for all the sub sites.

$SPWebApp = Get-SPWebApplication
foreach ($SPSite in $SPWebApp.Sites)
if ($SPSite -ne $null)
$web = Get-SPWeb $spsite.Url
$web.AllProperties[“SRCH_SB_SET_SITE”] =  ‘{“Inherit”:false,”ResultsPageAddress”:”/sites/SearchCenter/Pages/results.aspx”,”ShowNavigation”:false}’
$web.AllProperties[“SRCH_ENH_FTR_URL_SITE”] = ‘/sites/SearchCenter/Pages’

In the above code make sure you update the full url of the search center if the web app is different for the search center other wise relative path should work.




Optimizing SharePoint 2013 Server Performance – Development Server (single server)

There were couple of new services introduced with SharePoint 2013 and raised the hardware resource requirements. Let’s only talk about those process and steps to control the resource consumption when it comes to a single server SharePoint 2013 installation.

  • ·         NodeRunner service
  • ·         Distributed Cache Service
  • ·         Count of Web Application
NodeRunner service
  1. Use Set-SPEnterpriseSearchService -PerformanceLevel Reduced to reduce the CPU impact the search service has on your test environment.
  1. Modify the C:Program FilesMicrosoft Office Servers15.0SearchRuntime1.0noderunner.exe.config so that it can only consume X amount of RAM.
    Change the value at to any amount of RAM you like to contain the memory leak. May be 250 MB per instance of this service.
Even with this 250 MB limit I experienced some NodeRunner crashes. The general advice is to NOT change the NodeRunner memory limit configuration less than 250 MB. And NEVER EVER do this in a production environment!
Some of the pain points by the above modifications:
·         Changing this configuration file is not supported. For test/dev deployments it may have a desired effect on memory usage if you are running with less memory than the recommended minimum.
·         This means it may reduce the initial allocation of memory, but if the application requires more memory than this limit, it will crash. Hence, do not make such a change on a production deployment.
·         You may see errors like: Unable to connect to system client with derived management URIs. Exception: Failed to connect to system manager. Microsoft.Office.Server.Search.Administration.Topology.ApplicationAdminLayer.Reconnect() c80fcf9b-cf6b-2083-a27f-5d57c7dc4ef3.   Deeper analysis of the ULS logs shows that the DBConnector created by the NodeRunner process threw an OutofMemory exception. Removing the Noderunner.Exe.Config memory restriction and rebooting the server allowed me to submit the topology change.
Distributed Cache Service
A new caching service is added in SharePoint 2013 called ‘Distributed Cache Service’ which is built based on Windows Server AppFabric Distributed Cache. Many features rely on this service to store data for fast retrieval when needed. This is used by services/features like Authentication Token Cache, Micro Blogging features, My Site Social Feeds etc.,
How to stop this service
This service can be managed from the ‘Services on Server’ page in the central admin. It can be started/stopped from here.
Allocate Less Memory
By default when SharePoint 2013 preview is installed, Distributed Cache Service’s memory allocation is set to 10 percent of the total physical memory allocation. Using the below PowerShell cmdlets we can change the memory allocation for this service.
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($ -eq $env:computername}
Set-CacheHostConfig -Hostname -cacheport 22233 -cachesize
The above cmdlets stops the Caching Service, and sets the memory allocation to the specified number of megabytes (MB), and then starts the Caching service.
Web Applications
As the number of web applications grow in these single server SharePoint Development server, the number of Application Pools grow (this is not true if we use the same application pool to create multiple web applications), but however, if we donot pay attention while creating new web application we end up creating new application pool as well. These application pools runs in their own memory space, which in terms consuming more memory or RAM. Each App Pool runs with a service called w3wp.exe. As these SharePoint development servers also runs visual studio and sql server on the same box we need to keep in mind on the amount of memory accessible to each application and service.
It was my attempt to throw some light on how we can restrict memory usage by these services and still have a server running optimally even with 6-8 GB of RAM.