LINQ to SQL : Too much CPU Usage: What happens when there are multiple users.
        Posted  
        
            by soldieraman
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by soldieraman
        
        
        
        Published on 2010-05-01T07:18:24Z
        Indexed on 
            2010/05/01
            7:27 UTC
        
        
        Read the original article
        Hit count: 666
        
I am using LINQ to SQL and seeing my CPU Usage sky rocketting. See below screenshot. I have three questions
- What can I do to reduce this CPU Usage. I have done profiling and basically removed everything. Will making every LINQ to SQL statement into a compiled query help? 
- I also find that even with compiled queries simple statements like ByID() can take 3 milliseconds on a server with 3.25GB RAM 3.17GHz - this will just become slower on a less powerful computer. Or will the compiled query get faster the more it is used? 
- The CPU Usage (on the local server goes to 12-15%) for a single user will this multiply with the number of users accessing the server - when the application is put on a live server. i.e. 2 users at a time will mean 15*2 = 30% CPU Usage. If this is the case is my application limited to maximum 4-5 users at a time then. Or doesnt LINQ to SQL .net share some CPU usage.  
© Stack Overflow or respective owner