Wednesday, May 13, 2015

Searching SharePoint using the REST Interface is very slow sometimes


Happened with me using SharePoint 2013 - calling the SP 2013 restful service to search the index, results come back quickly except for some calls it takes long time. This slowness occured almost every 10 minutes.

Example query as simple as the below: 

Checking the Windows Event Log (Event Viewer) showed an exception that is thrown every n minutes, the exception was:
"A certificate validation operation took X milliseconds and has exceeded the execution time threshold.  If this continues to occur, it may represent a configuration issue.  Please see for more details."
The trick was to only enable access to the internet on my SharePoint server to enable certificate revocation list (CRL) check for the SharePoint root certificate without causing delays to the original _api request.
There are other solutions if you dont want your server to have access to the internet:
  1. Install the SharePoint Root Authority certificate in the Trusted Root Certification Authorities store
  2. Disable the automatic update of root certificates on the SharePoint Servers

These 2 solutions are escribed in details here 

Hope this helps