Performance Best practices

Mar 3, 2009 at 4:00 PM
Edited Mar 3, 2009 at 4:36 PM
Hi There, this is a great app. It really saved a lot of development time for me. 

I am implementing Faceted Search 2.5, for one of my clients and the performace is not that good. It takes around 16 seconds to return a result, in general the OOB search takes less than 1 second. I am running 2 WFEs, 1 Index server and 1 DB SQL Server 2005. all the servers are 32 bit and 4 GB RAM with 250 GB data and around million documents. Also, it looks like the Caching doesn't work, I have set caching as OOB 2 mins for short and 20 mins for long, but the result always show the results are not cached, also, Enabling Stemming doesn't work in Faceted Search, also, changing the Numbe4r of Facets column in data source to 30000 [max allowed facets], hangs facets [I have kept the page open for couple of hours before giving up on the search facets results displayed for 30,000 facets] am I missing something?  Are there any best practices on implementing Faceted Seaerch? If someone can give me any pointers on performance improvements, it will be really great.

Thanks for your help.


Mar 3, 2009 at 11:44 PM
Nilesh, the performance you've described is terrible for your topology. However, it's hard to point where the problem is w/o assessing the farm. Possibly problem's not with Facets. You'll have to troubleshoot your environment and get perfom metrics. Publish your findings then and we will see.
Mar 4, 2009 at 8:53 AM
Edited Mar 4, 2009 at 9:55 AM
Hi Leonidly,

Thanks for your prompt response. Before I get started with performance metrics, could you please highlight the best practices or the most efficient way of deploying Faceted Search? That will  be great.

Some initial investigation of the logs showed me this error in our front end event logs. It looks like Enterpriselibrary is throwing SQL connection error for some of the processes, this happens everytime searched using search results page with Search Facets. Could you please let me know if you are familier with this issue?

Timestamp: 04/03/2009 09:54:05

Message: HandlingInstanceID: xxxx

An exception of type 'System.Data.SqlClient.SqlException' occurred and was caught.


03/04/2009 09:54:05

Type : System.Data.SqlClient.SqlException, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089

Message : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source : .Net SqlClient Data Provider

Help link :

Errors : System.Data.SqlClient.SqlErrorCollection

Class : 20

LineNumber : 0

Number : 2

Procedure :

Server :

State : 0

ErrorCode : -2146232060

Data : System.Collections.ListDictionaryInternal

TargetSite : Void OnError(System.Data.SqlClient.SqlException, Boolean)

Stack Trace : at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)

at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)

at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)

at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)

at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)

at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)

at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

at System.Data.SqlClient.SqlConnection.Open()

at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection()

at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection(Boolean disposeInnerConnection)

at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection()

at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)

at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String tableName)

at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet(DbCommand command)

at Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore.LoadDataFromStore()

at Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.BaseBackingStore.Load()

at Microsoft.Practices.EnterpriseLibrary.Caching.Cache..ctor(IBackingStore backingStore, CacheCapacityScavengingPolicy scavengingPolicy, CachingInstrumentationProvider instrumentationProvider)

at Microsoft.Practices.EnterpriseLibrary.Caching.CacheManagerFactoryHelper.BuildCacheManager(String cacheManagerName, IBackingStore backingStore, Int32 maximumElementsInCacheBeforeScavenging, Int32 numberToRemoveWhenScavenging, Int32 expirationPollFrequencyInSeconds, CachingInstrumentationProvider instrumentationProvider)

at Microsoft.Practices.EnterpriseLibrary.Caching.CacheManagerCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)

at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)

at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)

at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, IConfigurationSource configurationSource)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase`1.CreateDefault()

at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager()

at Microsoft.SharePoint.Portal.ExtendedSearch.WebControls.SearchProcessor.GetCachedData(String selectColumns, Int16 resultsPerPage, Int32 longCacheTimeout, Int32 fastCacheTimeout, Boolean& usingCachedData, Boolean& run2ndTime)

Additional Info:

MachineName : XXX

TimeStamp : 04/03/2009 09:54:05

FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=, Culture=neutral, PublicKeyToken=a646907c4a695009

AppDomainName : /LM/W3SVC/201603377/Root-1-12880633763333322

ThreadIdentity : domain\userid

WindowsIdentity : domain\userid

Category: General

Priority: 0

EventId: 100

Severity: Error

Title:Enterprise Library Exception Handling

Machine: machinenamexxxx

Application Domain: /LM/W3SVC/201603377/Root-1-128806337682362342

Process Id: 3912

Process Name: c:\windows\system32\inetsrv\w3wp.exe

Win32 Thread Id: 268

Thread Name:

Extended Properties: HelpLink.ProdName - Microsoft SQL Server

HelpLink.EvtSrc - MSSQLServer

HelpLink.EvtID - 2

HelpLink.BaseHelpUrl -

HelpLink.LinkId - 20476


For more information, see Help and Support Center at

Mar 4, 2009 at 4:24 PM
Edited Mar 5, 2009 at 11:54 AM
Found it!

I was looking at the above error, and was going through the SQL Server with my DBA and found that the SQL server has 3 isntances and I have not specified the instance name of the server in my web.config while configuring the enterprise library/Faceted Search. so, the lesson is always include the intance name while referring to the SQL server! now the search query hardly takes 2 seconds!!

Thanks leonidly for your help.