Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Session Performance

I'm experiencing performance issues on my asp.net application. Sometimes it would take the client 30-40 seconds to execute a command, where as in sometimes it would take 3-4 seconds. I tried SQL Profiler and I don't see any problems. I was not able to replicate the issue on my side, under the same scenario when the client was trying.

I'm thinking that it might to do with session variables i'm using. I am using a lot of them to pass information within the page. However I Do not clear them.

If I clear them would it help? and if So Would this affect other users. Or does it only clear for that user?

Any help is appreciated.

like image 902
Jacob Avatar asked Nov 15 '22 07:11

Jacob


1 Answers

There was a record locking problem in one of the stored procedures in the .NET 2.0 implementation of SQL Server-based session storage. It looks like MS incorporated the fix in the .NET 4.0 release.

Take a look here: http://sanjevsharma.blogspot.com/2008/03/improving-aspnet-session-state-database.html

I'm 99% sure you can run the 4.0 version of aspnet_regsql -ssadd and still run ASP.NET 2.0 against it. I remember doing a diff of the 2.0 vs. 4.0 SQL script and the above fix was the only real difference. MS' implementation of the fix was a little nicer than (and clearly based on) the link above.

like image 182
scottt732 Avatar answered Dec 21 '22 16:12

scottt732