Monday, June 10, 2013

Search - One or more property databases have fragmented indices.

Heavily fragmented indexes can degrade query and crawl performance.

Cause :

Fragmentation exists when indexes have pages in which the logical ordering, based on the key value, does not match the physical ordering inside the data file. All leaf pages of an index contain pointers to the next and the previous pages in the index. This forms a doubly linked list of all index/data pages. Ideally, the physical order of the pages in the data file should match the logical ordering. Overall disk throughput is significantly increased when the physical ordering matches the logical ordering of the data.
Effects on Performance :

1. Query latency might increase.
2. Crawl rate may decrease as more time is spent writing metadata to the property database.
3. The property database defragmentation health rule detects that one or more property databases have fragmented indexes and attempts to correct the fragmentation. Note: when this rule is correcting the fragmentation, query latency and crawl rate are affected.
If you see a message like "Search - One or more property databases have fragmented indices." in Central Administration > Monitoring > Review Problems and Solutions

One of the possible Resolution is :

1.Go to Central Administration > Manage service applications > Search Application > Index reset in Left navigation > Reset Now
2.Go to Central Administration > Manage service applications > Search Application > Manage Content Sources > Sart Full Crawls for Content sources in the order of importance as per you business needs.

Reference :    One or more Search property databases have fragmented indices (SharePoint Server 2010) 

Saturday, June 8, 2013

Best practices for Blob cache

Blob cache is to reduce traffic in b/w sql server and front ends. So a copy of frequently accessed files is kept on each WFE. Enabling blob cache also passes information in http headers to client browser to fetch the data from cache rather than round trips.

This needs publishing framework. You might have to increase RAM on each front end on average by 800 bytes per file. Also, server relative urls should be less than 160 characters to be blob cached (with a path in file system as less than 260 characters)





But sometimes large blob cache will reduce your performance rather helping with heavy loads. Blob cache index are written to hard drive periodically and before recycle. When this serialization is progress, it will affect the time taken to serve the client request.

It is even more devastating when app pool recycle corrupt indexes and files are no longer being fetched from blob cache ; this happens generally because - if timeout for recycle is lower than time taken to save the indexes on disk





Best practices for Blob cache:



1. Try to keep the content stable for live environments and blob cache should be planned for content with lesser changes, when blob is invalidated by Framework?

2. Better to add mime types for files being blob cached.  Alternate in webconfig [ BlobCache node] use parameter browserFileHandling = "nosniff"  [ possible values nosniff|strict ]

3. The content in blobcache folder should be managed by framework. Let it be created and managed by SharePoint.

4. Server relative urls should be less than 160 characters to be blob cached ( with a path in file system as less than 260 characters)

5. How to flush blob cache ?

6. For large blob cache increase parameter WriteIndexInterval in webconfig [ BlobCache node]. Default is 60 . You might want to serialize it may after 1 hour [ 86400] for very large blob cache. { this setting is not recommended for small blob cache size }

7. Recommended time limits to shut down and start up web application is 300 seconds. Default is 90 seconds. For large blob cache you might even go up to 600 seconds.

8. Plan for sufficient disk space as per size of content.

You may also like:

Include specific folder content in BlobCache SharePoint


when blob cache must be invalidated by framework ?


System.UnauthorizedAccessException to BlobCache Folder


Getting multiple hits to files after enabling BLOB cache


One thought on “Best practices for Blob cache

I am getting below mentioned error in Microsoft.SharePoint.Publishing.BlobCache.CreateFile(String tempFileName, SPFile file, BlobCacheEntry target, Int32 chunkSize) :
Process : w3wp.exe (_x-_-_)
Thread ID : _x-_-_
Area : SharePoint Foundation
Category : Performance
Event ID : n-_-
Level : Monitorable
Message :
An SPRequest object was reclaimed by the garbage collector instead of being explicitly freed. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. Allocation Id: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx} This SPRequest was allocated at at Microsoft.SharePoint.Library.SPRequest..ctor() at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPWeb.InitializeSPRequest() at Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName) at Microsoft.SharePoint.SPListCollection.ItemByInternalName(String strInternalName, Boolean bThrowException) at Microsoft.SharePoint.SPItemEventProperties.get_List() at Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver.ItemUpdating(SPItemEventProperties properties) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiver(SPItemEventReceiver receiver, SPUserCodeInfo userCodeInfo, SPItemEventProperties properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiverHelper(Object receiver, SPUserCodeInfo userCodeInfo, Object properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.c__DisplayClassc`1.b__6() at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPUserToken userToken, Guid tranLockerId, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](Byte[] userTokenBytes, Guid tranLockerId, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.ExecuteItemEventReceivers(Byte[]& userToken, Guid& tranLockerId, Object& receivers, ItemEventReceiverParams& itemEventParams, Object& changedFields, EventReceiverResult& eventResult, String& errorMessage) at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, String& pEtagNew, String& pContentTagNew) at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, String& pEtagNew, String& pContentTagNew) at Microsoft.SharePoint.SPFile.GetFileStreamCore(OpenBinaryFlags openOptions, String etagNotMatch, String& etagNew, String& contentTagNew) at Microsoft.SharePoint.SPFile.GetFileStream(OpenBinaryFlags openOptions, String etagNotMatch, String& etagNew, String& contentTagNew) at Microsoft.SharePoint.SPFile.OpenBinaryStream() at Microsoft.SharePoint.Publishing.BlobCache.CreateFile(String tempFileName, SPFile file, BlobCacheEntry target, Int32 chunkSize) at Microsoft.SharePoint.Publishing.BlobCache.c__DisplayClass34.c__DisplayClass37.b__31() at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock) at Microsoft.Office.Server.Diagnostics.ULS.SendWatsonOnExceptionTag(UInt32 tagID, ULSCatBase categoryID, String output, Boolean fRethrowException, TryBlock tryBlock, CatchBlock catchBlock, FinallyBlock finallyBlock) at Microsoft.SharePoint.Publishing.BlobCache.c__DisplayClass34.b__30() at Microsoft.SharePoint.SPSecurity.c__DisplayClass4.b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at Microsoft.SharePoint.Publishing.BlobCache.FetchItemFromWss(Uri path, Boolean isHostNamedSite) at Microsoft.SharePoint.Publishing.BlobCache.RewriteUrl(Object sender, EventArgs e, Boolean preAuthenticate) at Microsoft.SharePoint.Publishing.PublishingHttpModule.AuthorizeRequestHandler(Object sender, EventArgs ea) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
Please share your thought on this .


Wednesday, June 5, 2013

cache user accounts

For FBA web application using claims, we should specifically use FBA user like 0#.f|abc|username for SuperReader and SuperUser accounts.

Choose two such accounts , preferably new one.

Visit user policy for web application  under central admin

With option all zones, give superUser Full Control and SuperReader Read rights.

Set superReader and SuperUser  fr caching by below mentioned powershell command :

$myWebApp = Get-SPWebApplication -Identity "<WebApplication>"
$myWebApp.Properties["portalsuperuseraccount"] = "<SuperUser>"
$myWebApp.Properties["portalsuperreaderaccount"] = "<SuperReader>"
$myWebApp.Update()

 

Now go for one IISRESET

when blob cache must be invalidated by framework ?

As a general rule any kind of change in file content or permissions should force the cache to be rebuilt.

When a change is observed , file is removed from indexes.




OperationEffect on BLOB Cache
Editing a file that is BLOB cachedThe cached file is removed from the cache.
Deleting a file that is BLOB cachedThe cached file is removed from the cache.
Deleting a file that is not BLOB cachedAll cached files in the list containing the file that was deleted will be removed from the cache
Deleting a folder in a listAll cached files in the list containing the folder that was deleted will be removed from the cache
Renaming or Deleting a listAll cached files that were in the list will be removed from the cache
Making any changes to a list

  • ·         Permissions

  • ·         Title, or Description

  • ·         Adding or Removing Content Types

All cached files that were in the list will be removed from the cache
Renaming or Deleting a webAll cached entries in the web are removed from the cache
Adding or removing permissions to a web, changing inheritance, adding, updating, or deleting rolesAll cached entries in the web are removed from the cache
Deleting a site collectionAll cached entries contained in the site collection are removed from the cache
Modifying User Policy on the web applicationEntire cache is abandoned, a new cache folder is started

Ref : http://technet.microsoft.com/en-us/library/ee424404(v=office.14).aspx

You may also like:

Include specific folder content in BlobCache SharePoint


System.UnauthorizedAccessException to BlobCache Folder


Getting multiple hits to files after enabling BLOB cache

Getting multiple hits to files after enabling BLOB cache

SharePoint Blob Cache is capable of responding to partial content requests.
For large file size client application like media player can decide to send partial requests to server(you ca see requests with status code 206 in IIS logs). SharePoint Server ignores partial content requests and responds to these requests with the entire file , if blob cache is disabled.

So quite possible you get these multiple requests for large files , which were earlier being sent to browser in single request, but since now you have blob cache support , they are divided in to chunk requests.

You may also like:

Include specific folder content in BlobCache SharePoint


System.UnauthorizedAccessException to BlobCache Folder

Tuesday, June 4, 2013

System.UnauthorizedAccessException to BlobCache Folder

This is a common scenario that we use blobcache in multiple application hosted under same server, but they are running under different app pool /app pool accounts.

This can even make your server slow or stop responding with access denied message for blob cache folder.

Here are few work arounds you can go for :

  1. For each web app , use new root folder in drive.

  2. Give WSS_WPG full access on all these folders.

  3. Use same app pool account for all web applications using blobcache.

References:

http://technet.microsoft.com/en-us/library/cc263445.aspx

http://support.microsoft.com/kb/2015895

You may also like:

Include specific folder content in BlobCache SharePoint


Getting multiple hits to files after enabling BLOB cache



SharePoint 2013 - Authentication, authorization, and security


  • User sign-in


  1. Classic-mode authentication is deprecated  and manged only by powershell , now claims is the default one. PowerShellcmdlet called Convert-SPWebApplication  can be used to migrate accounts , MigrateUsers method is deprecated  Ref :  http://msdn.microsoft.com/en-us/library/gg251985.aspx

  2. Requirement to register claims providers is eliminated

  3. SharePoint 2013 Preview tracks FedAuth cookies in the new distributed cache service using Windows Server AppFabric Caching.

  4. Better log management and depth of logs .


  •  Services and app authentication


  1. for more info on app principal , please visit  Build apps for SharePoint.

  2. server-to-server security token service (STS) provides access tokens for server-to-server authentication .

Ref : http://msdn.microsoft.com/en-us/library/ms457529.aspx

You may also like:

Authorization/Authentication