Delay in handing over requests between the web layer and the app (IIS not able to process less than 500 ms but its taking more time to process) getting 200 code

vijay reddi 0 Reputation points
2025-09-15T13:58:28.3233333+00:00

Hello Microsoft Team,

We have an issue with Web layer (one of the web service (.asmx) web request is taking more time it should be less than 500 ms but its taking more than that, how to troubleshoot this issue step by step & how to fix it , help me. let me know if need any more info.

hosted IIS 10 ( we have 4: Web servers and 6 App Servers).

Thanks

Vijay

Developer technologies | ASP.NET | ASP.NET API
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,191 Reputation points Volunteer Moderator
    2025-09-15T15:51:04.5666667+00:00

    you can't fix performance issues without proper logging. see:

    https://free.blessedness.top/en-us/aspnet/core/performance/diagnostic-tools?view=aspnetcore-9.0

    you need to determine the code that is causing the issue. once you know what code is taking the time, you can tune it.

    0 comments No comments

  2. Danny Nguyen (WICLOUD CORPORATION) 3,500 Reputation points Microsoft External Staff
    2025-09-16T04:07:56.6266667+00:00

    Hi @vijay reddi ,

    Thank you for sharing your problem.

    When you see a 200 response but time-taken is >500 ms, the delay is probably in the application code or a downstream dependency. Here’s a how you can troubleshoot:

    1. Review IIS logs
      • Check the time-taken field in the W3C logs. Identify which URLs are consistently slow and whether it happens on all web servers or just some of them.
    2. Enable Failed Request Tracing (FREB)
      • Configure a rule for status code 200 with time-taken > 500 ms.
      • FREB reports show exactly where the time is spent (IIS pipeline vs handler execution).
    3. Check server performance counters Collect a short PerfMon trace on both web and app servers. Key counters:
      • ASP.NET\Requests Queued, Requests Current, Request Execution Time
      • ThreadPool available worker/I/O threads (check for starvation)
      • CPU, memory, disk, and network utilization
    4. Test between tiers
      • Run a simple Invoke-WebRequest or curl directly from a web server to the app server endpoint. This confirms whether latency is introduced on the web tier, app tier, or downstream.
    5. Inspect application code patterns Common causes for delays in ASMX/.NET apps:
      • Blocking calls (.Result, .Wait()) leading to thread starvation
      • Creating a new HttpClient per request (socket exhaustion)
      • Slow DB queries or synchronous I/O
      • Low ServicePointManager.DefaultConnectionLimit causing queued outbound calls

    Fixes usually come down to:

    • Convert to proper async I/O, reuse HttpClient (or use HttpClientFactory), and optimize database queries.
    • Apply caching for repeated calls.
    • Tune app pool settings (queue length, recycling) and connection limits if needed.

    This workflow (logs → FREB → PerfMon → direct tests → code inspection) usually isolates whether the extra latency comes from IIS pipeline, application logic, or backend dependencies.

    Hope this helps. Please reach out if you encounter any problem.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.