Recently I programmed an ASP.NET MVC 4 web application using Entity Framework, Razor - quite large (about 90 entities, many forms etc.). Everything worked fine and quite fast in my development environment.
Troubles started in moment of deploying the application on ther server and when more concurrent users started to appear on website. Many users are experiencing very slow load. In some cases it looked like when one user blocking another until his request is completed (logging in, out etc.). I have read about not using Sessions in ASP.NET, but I also read that each user has its own session, it is thead safe, so sessions between themselves should not influence each other. In most cases entity framework queries are only reading data so database locks should not appear often, but I do not really know. However pages became very slow when there are on the server about 20 people at same time.
I need to load / store user profile - column widths, settings, ordering etc. - and use it in views and controllers, that is why i am using session. Session lock should be blocking only concurrent requests of user himself until completed, not the other one, am I right? I also use repeated ajax requests for displaying time-related information. And something in my application causes big hangs when there are more people on the web. When I am alone on the web, everything works fast. I am quite new to this and dont know much where to start digging.
Are there any best practises for avoiding such problems, or any idea about what sort of techniques can cause such problems?