c# – Application stopping when there are too many users accessing


My application is crashing and I don't know exactly why. The only thing I notice is that when there are many users accessing, or making requests, this happens.

When it happens I have to restart the application pool and start the application again.

My question is: how should I investigate this?

I don't know how to simulate many users accessing.


There can be many factors and it is difficult to determine without knowing your environment. What I would recommend doing is this:

  1. Try to check the performance of your application's queries and if it doesn't let you query large tables entirely (Ex: query screens where you don't specify anything and it returns all the table records at once). Several of these occurring at the same time will crash the bank.

  2. Check if there is any case where the database is locked (locked) when inserting or updating a table for a long time, as it may happen that you insert or update a table without committing or rolling back, executing a long query before committing and in the meantime another user would try to do the same process, locking the bank.

  3. Always after running an application script, make sure the connection is closed before closing it. Usually MVC already handles this, but in applications where you need to open the connection manually, they must be closed when exiting the application, avoiding leaving locked tables

Scroll to Top