Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

our project is using linq to sharepoint , its working well the only problem we are facing is the extra CPU usage its taking , even if only two or three users concurrently accesses the local testing server on which the application is deployed , the cpu consumption shoots up to 100% and it takes about a good 20 to 30 seconds until it gets back to normalcy , this is only ocurring when we are acessing the module that uses linq to sharepoint for data access , the application is behaving alright otherwise

the local testing server's specification 8gb ram core i3

share|improve this question
    
are you sure that linq to sharepoint is causing the load? what are the reasons that you thinkt that linq2sp is responsible for this? –  Bas Lijten May 4 '12 at 6:55

1 Answer 1

Whenever you're using LINQ to SharePoint you should look at any CAML which is generated from queries (see How to: View CAML Generated by LINQ to SharePoint). Because if Linq2SP can't figure out how to generate a proper CAML it'll silently generate a limited CAML returning way more data than needed and not sorted and then do further selection and sorting in memory.

One of the examples I've see is selecting top ten items with a certain choice column value sorted by a field being turned into return all items, and then do the rest in memory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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