# Why your .NET AI request is slow: a segment-by-segment teardown

> Source: <https://dev.to/karlmoriaty/why-your-net-ai-request-is-slow-a-segment-by-segment-teardown-5f4o>
> Published: 2026-11-28 11:41:57+00:00

**Recommendation:** Break LLM request latency into queue, connect, upload, provider-queue, TTFT and generation segments so you can pinpoint whether DNS, upload, provider queueing or streaming is the bottleneck.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

A support assistant answers in eight seconds. The HTTP span says `200 OK`. The database span is fast. The LLM span is "slow". None of that tells you whether the time went into DNS, TLS, uploading the prompt, provider queueing, the first token, or streaming the answer.

General APM was designed for request/response services. LLM calls have a different shape:

Runesvaner is an in-process profiler for .NET AI workloads. This post walks through the measurement model and the numbers behind it — including what cannot be measured.

| Segment | What it means | Source | 
|---|---|---|
| Queue | Middleware and serialization before the HTTP call | Stopwatch | 
| Connect | DNS + TCP connection | `SocketsHttpHandler.ConnectCallback` | 
| Upload | Request body serialization | `HttpContent` wrapper | 
| ProviderQueue | Wait for response headers | Stopwatch | 
| TTFT | First non-empty text delta | MEAI decorator | 
| Generation | Response stream until EOF | Stream wrapper |
