Bart
Bart

Reputation: 4920

ASP.NET App Performance due to too many exceptions

I am doing load testing for my Application, I am running 250 virtual users to access my website.I am using HP Load Runner.

After 40 minutes of load testing, I checked # of Exceptions thrown counter, it is 11000 exceptions.

How bad is that? what is the recommended fix?

Upvotes: 0

Views: 356

Answers (3)

Glenn Ferrie
Glenn Ferrie

Reputation: 10410

You should not allow that many exceptions in your code that is a huge performance hit. Suggest catching the simpler one earlier and avoiding them with the appropriate checks. No one deserves to see in an 'Object Reference not set to an instance of an object', not even YOUR listener.

Upvotes: 0

Valamas
Valamas

Reputation: 24759

Look for the most frequent exception type or location of the most throw new exception and code safe guards to avoid throwing an exception.

Upvotes: 0

Sidharth Panwar
Sidharth Panwar

Reputation: 4654

You shouldn't be throwing so many exceptions. Check if these are exceptions like NullReference , ArrayOutOfBounds, ArgumentException etc. These must never occur in your code.
Try to categorize the type of exceptions that are coming and from where they are coming.
Read this wonderful article by Jon Skeet on how costly exceptions are in .Net: http://www.developerfusion.com/article/5250/exceptions-and-performance-in-net/

Upvotes: 2

Related Questions