1

When I look into Azure App Service Diagnostics under performance and availability section they are stating that 4XX and 5XX errors could affect application's performance and availability.

enter image description here

Please explain and relationship between exceptions and web app performance and how exception degrades website performance.

AjayKumar
  • 2,812
  • 1
  • 9
  • 28
ManirajSS
  • 2,295
  • 5
  • 26
  • 50

2 Answers2

1

As Sajeetharan rightly mentioned exceptions can cause buckets of problems and I like the good quotation. For symptoms exhibiting- the pages loading slowly and sometimes timeout.

Such problems is often generally caused by application level issues, such as:

  • requests taking a long time.
  • application using high memory/CPU
  • application crashing due to an exception.

Just to isolate the issue, related to resource/infra - you can ensure "Always On" feature is enabled and you can scale-up the App Service plan.

Genererally - Troubleshooting such performance issues can be divided into three distinct tasks, in sequential order as mentioned in this very informative document (highlighting some of them here for clarity and convienence):

  1. Observe and monitor application behavior
  2. Collect data
  3. Mitigate the issue

App Service gives you various options at each step:

1A - Track Service health -Azure publicizes each time there is a service interruption or performance degradation.

1B - Monitor your app -This option enables you to find out if your application is having any issues.

1C - *Monitor web endpoint status -Endpoint monitoring configures web tests from geo-distributed locations that test response time and uptime of web URLs.

1D - Application performance monitoring using Extensions - You can also monitor your application performance by using a site extension.

2A - Enable web server diagnostics -you can enable logs such as- Detailed Error Logging, Failed Request Tracing & Web Server Logging

2B - Enable application diagnostics -collect application performance data from App Service

2C - You can enable the Application Insights Profiler to start capturing detailed performance traces.

2D - Remote Profiling is useful if the CPU usage of the process is high and your process is running slower than expected, or the latency of HTTP requests are higher than normal.

2E- Leverage Kudu console - Kudu is a diagnostic console, in case your application is throwing first-chance exceptions, you can use Kudu and the SysInternals tool Procdump to create memory dumps. These memory dumps are snapshots of the process and can often help you troubleshoot more complicated issues with your app.

3.Scale-up/Scale-out & Recycle - Based on the application requirement you can scale-up the resource and recycle/restart as necessary.

Apologies for the long response, just shared several options to narrow-down the issue. Hope the above information helps! Let us know how it goes we would be more than happy to help you investigate/rectify the issue further.

AjayKumar
  • 2,812
  • 1
  • 9
  • 28
0

This is not only specific to Azure, but it is also common if you deploy your application anywhere (either in the cloud or on-prem). Exceptions can cause buckets of problems, especially for performance.

There is a saying

No matter how high the performance of your program is, as long as you did not handle the "exceptions", it's broke.

You need to cache data, handle exceptions, dispose resources and so on to avoid performance problems and site crash. For example, In a javascript application Callbacks often allocate memory, accumulation works but involve a lot of extra boilerplate and can be a pain to make threadsafe.

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • here is a good thread https://stackoverflow.com/questions/2184935/performance-cost-of-coding-exception-driven-development-in-java – Sajeetharan Dec 26 '19 at 06:59