Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth using PLINQ with ASP.NET?

Does anyone have experience using PLINQ with ASP.NET? Is this a good combination, or something to avoid in most situations?

I develop an intranet ASP.NET site for a lawfirm (~100 users). Several pages include non-trivial LINQ code, for example, we have a bank rec page that compares thousands of financial transactions between our accounting database and the bank's data, using LINQ to Datasets. This is slow, so I am tempted to try PLINQ, but I am worried this could lead to 1 request monopolizing the web server. Having the bank rec run 4 times faster but shutting all other users out while it is running would not be an improvement.

I know there are much faster solutions than LINQ, but I would rather have short code to maintain.

Right now, we have a Dual Pentium 4 web server, but I am hoping we can upgrade to decent hardware in the near future.

like image 663
Brad Avatar asked Dec 29 '09 18:12

Brad


2 Answers

Just from what I've heard, there are only a few cases where PLINQ is slower than LINQ. I hadn't heard any cases where PLINQ monopolized things as you described. Microsoft has a session at PDC09 PLINQ: LINQ, but Faster!. I hope this video will help you decide if PLINQ is right for you, but as they say, measure before and after. Good luck.

like image 77
Scott McClenning Avatar answered Nov 07 '22 08:11

Scott McClenning


I have a similar concern. I'm assuming plinq uses a backgroud thread from the thread pool, if this is the case then it would impact scalability of the site. You get by default 100 threads per cpu if you have a low used site you might want to burn some extra threads per user request, but I'd do so very cautiously

like image 26
En55 Avatar answered Nov 07 '22 07:11

En55