We have two 'identical' SharePoint farms; one production and one test. Both consist of 4 VMs with identical specifications. An application server, 2 WFEs and a SQL server. Both environments run a single web application which has the same WSP installed. The test environment has been restored from a site collection backup of the production environment so the content in both environments is for all intents and purposes the same. I have checked the load on all servers in both farms and resource usage (memory, disk, processor, network) is consistent for matching servers across both farms.

We have a publishing page on a web in the site collection which has a single web part which renders a custom view of an item from a list in the parent web that contains around 8500 items. The item is retrieved using Linq2SharePoint by the integer Id assigned by SharePoint when the item is created. In the production environment the page consistently takes around 10 seconds longer to load than on the test environment.

All other pages have roughly the same load times across the two environments. Other pages which perform the same function, using the same web part, but in different sub webs in the site collection have roughly the same load times. The performance difference is very specific to this one location where the web part is used.

I think I know where the delay is happening but have no idea why or how to resolve it. Studying the ULS logs and the trace output for the page in the production environment I can see the following line (obviously the execution time varies slightly between requests but is more or less consistent)

Leaving Monitored Scope (EnsureListItemsData#1). Execution Time=11006.7259945049

In the test environment the execution time is around 700ms. This seems a clear candidate for the approximately 10 second performance difference.

My question then is what is going on here? What happens in this method? Why is it taking so much longer in seemingly 'identical' environments? What can I do to resolve the problem?

  • do you resolve your issue? we faced with exact the same behavior... Commented Mar 18, 2014 at 20:02
  • No I never found the cause of this. We still see it intermittently and the location in the site collection varies. About the only suggestion I can make is to look for and eliminate any memory leaks in the page life cycle. Commented Mar 19, 2014 at 10:05

1 Answer 1


The best way to find what is causing the issue with performance is using SPMonitor scope . If you know the webpart which is causing the problem , put all the method calls under the SPMonitor scope for particular webpart. you will come to know what method is taking time in developer dashboard . Further put monitor scope for everyline of code . There might be indexing issues or recursive loops which might be causing the problem.

Example:- Put your method calls

using(new SPMonitoredScope(“My Scope Name”))


I had a code to loop folders in document library . The test took 10sec to load and prod was abt 70 sec . PS: adding Items to folder in sharepoint list programatically?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.