views:

80

answers:

4

HI,

I am developing asp.net mvc site with linq-to-sql we are having 1000 cocurrent users and we are having performance problems.

I have found that stackovewflow is also build on linq-to-sql? So can anybody know how they improved performance.

Without line performance was good each page are loaded in 3 seconds but after migrating to linq as per our client requirement page comes in 8 to 10 seconds which is not acceptable performance.

Our HTML is very clear but we are having very complex database operations.

Any tip or code will be best answer.

Thanks in advance,

+1  A: 

Are your database queries running fast enough - do you need to review your indexes?

Do you use caching where possible to hit the database less?

ck
I have already done that optimization
jalpesh
So is the 8 seconds processing in the front end?
ck
+3  A: 

I would recommend looking at the queries generated by LINQ, specially the complex ones and run them manually, grab the slow ones, optimize them by hand and try to translate that back to LINQ.

Probably slow and painful, but that's the best way to do it I think, LINQ to SQL rocks, but it cannot beat a hand coded optimized query, maybe something here and there is preventing SQL server from using indexes, etc, etc.

Francisco Soto
I have checked all the database options and its running perfect!!. We also have indexes and other stuff and its working fine.
jalpesh
A: 

check this : improve your LINQ query performance by 5 X times

article talks about Compiled LINQ query

http://www.codeproject.com/KB/linq/LINQquery.aspx

http://www.codeproject.com/KB/cs/linqsql2.aspx

Pranay Rana
+1  A: 

I replied to a similar question about this the other day. These are examples of how they made it work well on Stack Overflow:

http://www.codinghorror.com/blog/2009/06/all-abstractions-are-failed-abstractions.html

and

http://www.codinghorror.com/blog/2010/03/compiled-or-bust.html

Russ C