Support Case Study

How We Cut ASP.NET Core Latency
From 17s to Under 1s

A rogue SolidCP ScriptsModule added ~9 seconds per IIS request; after removal, ~3 seconds of ASP.NET Core Module pipeline overhead remained. Database Mart engineers moved the app to Kestrel as a Windows Service with IIS as an HTTPS reverse proxy—TTFB dropped to 0.917s on Windows Server 2019 with no OS reload and no impact to other IIS sites.

01 · Timeline

Incident Timeline

Jul 11
Ticket opened
13–17s external
Jul 12
Root cause #1
ScriptsModule
Jul 13–14
IIS audit
~4s remain
Jul 15–16
Root cause #2
IIS pipeline ~3s
Jul 20–21
Kestrel build
Windows Service
Jul 22
Resolved
0.917s TTFB

Two root causes over 11 days—17s → 4s → under 1s, no data loss.

02 · Resolution

How We Resolved It

July 11–12, 2026

Instant Locally, 13–17 Seconds Externally

ASP.NET Core under IIS: /api/test with return Ok() was instant on localhost but 13–17s externally. IIS time-taken matched on 200, 404, and 500—ruling out app logic.

Engineer Hiker tested a static test.txt externally—still 14s TTFB. FREB traced ScriptsModule (SolidCP) blocking ~3s at three pipeline stages (~9s total).

Global config was locked; site-level fix in web.config:

<system.webServer>
  <modules>
    <remove name="ScriptsModule" />
  </modules>
</system.webServer>

External TTFB dropped to ~3–4 seconds.

July 13–15, 2026

Full IIS Optimization — ~3s Still Remained

Engineer Queta applied AlwaysRunning, idle timeout 0, preload, module trims, HTTP/2, Defender exclusions, InProcess/OutOfProcess tests, and SQL connection tuning (~1s recovered). ~3s delay persisted identically on every request.

ScenarioTTFBVisual
Initial external13–17s
After ScriptsModule removal~4.0s
After full IIS + SQL tuning~3.2s
Direct Kestrel :5000~0.84s
Kestrel service + IIS proxy0.917s

July 15–22, 2026

Kestrel Windows Service — IIS as Pure Reverse Proxy

Direct Kestrel: 0.84s. Through IIS ANCM: 3.2s. FREB showed ~3.15s inside IIS before app code ran. Customer chose Option 1: Windows Service on localhost:5000, new IIS site for HTTPS rewrite only, original site renamed <SITE_NAME>.bak.

Internet (HTTPS)
↓ IIS <SITE_NAME> SSL only, no ANCM
↓ reverse proxy
Kestrel http://localhost:5000 Windows Service
↓ <APP_DLL>.dll
“Performance test: TCP 0.028s, TLS 0.104s, TTFB 0.917s—previously ~4s+ through original IIS ASP.NET Core hosting.”
Queta · July 22, 2026

Resolved No data loss No OS reload 17s → 0.9s

03 · At a Glance

Case at a Glance

11
Days
2
Root causes
94%
Latency reduction
0
Other sites affected

04 · Guide

Geek Tips — ASP.NET Core on Windows Server

T1Detect a Rogue IIS Module in ~10 Minutes

Large time-taken on static files → enable FREB, reproduce once, inspect module elapsed times at PRE_BEGIN_REQUEST / BEGIN_REQUEST. Watch panel-injected modules (SolidCP ScriptsModule, etc.).

T2Remove a Locked Global Module Safely

Avoid <clear /> (500.19). Use <remove name="ScriptsModule" /> in the site web.config only.

T3Is IIS the Bottleneck? 30-Second Test

Run dotnet <APP_DLL>.dll --urls http://localhost:5000 and compare curl -w TTFB to the IIS URL. A >2s gap implicates ANCM pipeline overhead.

T4Windows Service + IIS Reverse Proxy

Kestrel on localhost, IIS for SSL + URL Rewrite to http://localhost:5000—not an ASP.NET Core IIS app. Deploy: publish files, sc stop/start <SERVICE_NAME>.

“From 17 seconds to under one—two root causes, eleven days, zero data loss.”

When the logs say 13 seconds and the code says 0.8, the answer is in the pipeline.

Last Updated:   10/29/2026
Outline