> ## Content Index
> Fetch the complete content index at: https://devinside.cloud/llms.txt
> Use this file to discover other available public pages before exploring further.

# Measuring .NET Startup Through the First Correct Response
- URL: https://devinside.cloud/how-dotnet-runs-08-startup-first-response/
- Published: 2026-11-21T15:00:08.000Z
- Description: Measure the wait from process launch to valid XML, trace the first ASP.NET Core response, and turn a .NET 10 versus 11 CLI comparison into a nightly batch budget.
- Author: Marcin Borecki
- Tags: Languages, Runtimes & Performance, Performance & Data, .NET & C#, How .NET Runs Your Code, #Technology .NET, #Technology C#, #Technology ASP.NET Core, #Runtime JIT & AOT

**Series** · [How .NET Runs Your Code](https://devinside.cloud/how-dotnet-runs/), part 8 of 11\. Previous · [Build host, target, receiver](https://devinside.cloud/how-dotnet-runs-07-build-host-target-receiver/). Next · [CPU per completed job](https://devinside.cloud/how-dotnet-runs-09-steady-state-jit-vs-native-aot/)

Ravi has a script that sends 100 jobs to Intake, the fictional job-submission service. He proposes starting one instance, waiting for `/health` to say `ready`, then timing each submission. On his release slide, p95 would be the 95th value after sorting those 100 request durations from fastest to slowest. Dana wants to know what the first customer waits through during scale-out. Which clock on Ravi’s slide ever saw the process start?

Even the finish line needs a check. A diagnostic build returns HTTP 202 (Accepted) for a job named `rebuild-index`. It also returns 202 for a deliberately broken acknowledgement that names another job. If Intake is going to promise a time to the first correct result, Dana needs an event the customer can recognize and a fresh instance for each observation.

- Keep the listening line, validated health response, complete first response body and client verification as separate events. Each answers a different operational question.
- When sensor files arrived singly 120 ms apart, a 40 ms batching timer delayed alarms. When four arrived within 9 ms, a 10 ms timer could collect them for one launch. Measure from each file’s arrival to its checked alarm.
- On Windows, .NET 11 had a lower median block p99, but two of six paired blocks had a slower export tail. Keep the actual batch deadline separate from the per-export tail.
- A hundred POSTs to one process give one observation of its first POST. To set a first-caller p95, repeat the launch on the intended receiver and keep the unsuccessful attempts in the decision.

Working solution

### Intake 4.0 · How .NET Runs Your Code, parts 1 to 11

Use the .NET 11 and .NET 10 solution, Python 3.10 or later, `bench/harness/startup.py` and `src/Part08.Start` to follow the published API, worker and CLI. The archive includes ordered phase reports, the historical rehearsal inputs and the CPU-quota checks. Docker is needed for the container exercise. The optional diagnostic views use dotnet-trace and platform-specific file tools. The final solution built and passed its tests in Debug and Release on macOS and Windows.

[Download the solution (zip)](https://devinside.cloud/content/files/2026/11/how-dotnet-runs-11-v9.zip)

how-dotnet-runs-11-v9.zip · 26.24 MiB (27,510,833 bytes) · tag articles/how-dotnet-runs-08-v9 · MIT license

## One application offers several places to stop the clock

The operator submits `rebuild-index`. The API reads a name and payload size, enters the job in its in-memory journal and returns the assigned ID. To recognize success, the operator needs both that ID and the submitted name.

In a timed study Dana would start the client clock immediately before creating the process. In the three-platform API checks below, the harness recorded event order without taking an elapsed-time measurement. It reads the actual loopback address from the new instance's listening line. From there it can take two routes. In one it requests `/health`, checks for HTTP 200 and the text `ready`, and sends the first real POST. In the other it sends `POST /jobs` as the first HTTP request. Each route gets a fresh process. On the health-first route the POST is the first job submission and the second HTTP request.

The listening line gives the driver an address. A health response tells it whether that route works. Only the job response lets it check the submitted name. Suppose the server writes a 202 response with the wrong name. Which event would still appear in the server log, and which check would fail on the client?

A listening address and HTTP 202 still leave the client one decision The client receives the body and checks the expected ID and submitted name. A matching acknowledgement qualifies the observation. The wrong name is a failed attempt even with HTTP 202. Listening 202 + body Check ID + name Expected jobKeep the observation Wrong nameRecord the failure 

Both diagnostic submissions returned HTTP 202 and `Location: /jobs`. Only the response naming the submitted job qualified as a success.

There are two sensible client-side finish lines. For time to the full response, take the timestamp when the last byte arrives and keep it only if the subsequent check passes. For time to a result the caller can use, stop after that check. The timed driver calls those intervals `launch_to_first_verified_body` and `launch_to_checked_ack`, respectively. For an expensive decode or a large response the difference can matter to the caller even if the service has finished writing.

The code walkthrough follows one function in `startup.py`. The lambda is invoked by the HTTP helper immediately after it reads the whole body. A fresh process expects ID 1\. The second and third submissions to the same journal must return successive IDs. Which check would still fail after a successful socket read and a perfectly ordinary 202?

Code walkthrough

### The driver keeps the body-arrival mark only for an acknowledgement it can verify

```python
def submit(port, id, marks):
    marks.add(f'send-{id}')
    status, location, body = request(port, '/jobs', 'POST', JOB, lambda: marks.add(f'body-{id}'))
    ack = verify_ack(status, location, body, id)
    marks.add(f'verified-{id}', status=status, location=location, ack=ack)
```

1. The caller supplies the ID expected from this journal. The send mark precedes opening the connection for this request.
2. The callback records complete body arrival. Response headers by themselves would stop before the last body byte.
3. The check requires status 202, Location /jobs, the expected integer ID and exactly the submitted name in the parsed document.
4. A confirmed acknowledgement retains both marks. The measure command can therefore distinguish response arrival from the end of client verification.

From `submit` and `verify_ack` in `bench/harness/startup.py`. The failed wrong-name check is in the Mac phase records under `results/mac/part08`.

In the separate diagnostic API, the client received `{"id":1,"name":"rebuild-index"}` on the valid path. The control's later response contained `{"id":2,"name":"wrong-name"}`. Both had the expected status and location. Counting 202s alone would let the broken response improve a release metric. An incorrect result must stay in the record as a failure, with the attempted configuration and input.

.NET · macOS Arm64Follow one process from launch to the verified acknowledgement, then compare the same checkpoints in the other three publications. [Full recording](https://devinside.cloud/content/media/2026/11/how-dotnet-runs-08-s1.mp4)

## A new process can inherit a warm filesystem

Dana stops the API after it acknowledges job 1 and starts the same files again. The next job gets ID 1 again. That is evidence of a fresh journal. What can she infer about the machine that served the executable's pages? Follow the lifetime of each piece of state before calling a test “cold”.

| State                       | What the next launch gets                                                                                    | What to record                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| API process                 | A new managed heap and journal. In an ordinary build the process starts its own just-in-time (JIT) compiler. | One launch and one checked first acknowledgement for that process                                        |
| File-backed pages in the OS | The kernel can reuse a resident page of an executable or library when the next process maps the same file    | Record cache state as uncontrolled unless the experiment established it. An open call identifies a path. |
| Image layers on the node    | The container runtime can reuse locally stored layers when creating a new container                          | Record the image digest, the pull policy and which layers required transfer.                             |

A node can already store the entire image and still need to read an executable page from storage. Conversely, a new container can start a fresh process while file pages from an earlier replica remain resident. The restarted program’s ID sequence tells Dana about its journal. The two cache questions require observations on the node. [Linux kernel page-cache documentation](https://docs.kernel.org/admin-guide/sysctl/vm.html?ref=devinside.cloud#drop-caches) · [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/?ref=devinside.cloud#image-pull-policy).

Two historical course studies on the shared Mac started ordinary JIT, precompiled ReadyToRun and Native AOT (ahead-of-time) builds. The November 20 rehearsal recorded three first responses per build and eight later requests per process. Its file identifies the binary and round, with cache state uncontrolled and no load reading for individual launches. The November 21 study recorded host load. In the earlier rehearsal below, what happens to the comparison between the two managed .NET 11 builds when you advance from round two to round three?

Measured

### The same published file can produce a very different first observation

| Course rehearsal, Mac Arm64 | Round 1 | Round 2 | Round 3 |
| --------------------------- | ------- | ------- | ------- |
| .NET 11 ordinary            | 1487.7  | 469.6   | 153.8   |
| .NET 11 ReadyToRun          | 1069.2  | 136.8   | 157.2   |
| .NET 11 Native AOT          | 373.8   | 33.7    | 38.3    |
| .NET 10 ordinary            | 1362.5  | 457.5   | 260.2   |
| .NET 10 ReadyToRun          | 1101.4  | 286.1   | 249.4   |
| .NET 10 Native AOT          | 442.3   | 135.7   | 140.9   |

1. Each cell's first launch is its slowest of these three. The first condition remains part of what this receiver experienced.
2. The ordinary and ReadyToRun processes on the newer runtime shift by different amounts in the second round. Each bar represents one launch.
3. Compare the two managed builds on the newer runtime again. Their order can change even though each still runs the very same files.
4. Three observations per build exercise the procedure. The spread and order change leave the release team's latency budget open.

Historical course rehearsal on the shared Mac, November 20\. Launch to first verified response, n = 3 per cell, uncontrolled caches, contemporaneous load unrecorded. Milliseconds rounded from lab-carryover/runtime-investigation/results.json; the later course study documented the shared, loaded host.

The ordinary .NET 11 build moved by nearly a factor of ten between its first and third launches. Its third launch also reversed its order against ReadyToRun. Averaging the three would discard the round number, the one clue Dana needs to investigate what changed on the receiver.

The later course study randomized six builds over 20 rounds and 120 launches. Its one-minute load averages at launch ranged from 44.8 to 48.8 on a Mac with 16 logical CPUs. Those are the documented conditions of a shared, loaded host. In each cell, those later data put round one between 3.7 and 7.5 times its median of rounds two through twenty. Interleaving reduces a systematic order effect between modes, but cannot reconstruct what pages were resident before a launch. An open-file trace can show that a file was requested. It cannot prove that reading it required physical storage I/O. The first round therefore stays labeled *first observed, caches uncontrolled*.

## Open one start before assigning its cost to the JIT

Which work can the team actually locate between process launch and a correct reply? The ordinary command-line host resolves the runtime configuration and its host components, then starts CoreCLR. In a managed CLI launch on the Mac the host's own trace named `libhostfxr.dylib`, `intake.runtimeconfig.json`, the host-policy invocation and `libcoreclr.dylib`. The native CLI accepted the same payload check without producing that resolution log. A native executable still has to be loaded, initialize runtime services and execute the application's own startup code. [.NET host tracing settings](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables?ref=devinside.cloud).

The phase probe is a separate web application built over the Intake contracts. It marks entry into `Main`, host construction, listening, health, submission and response writing. After validating the response, the external client calls a separate endpoint. That later signal gives the server trace a witness to an action that happened on the client.

Open the Windows trace and look past the first `AckWritten`. The valid submission has a later `ClientReportedVerified`. After the wrong-name response, the second `AckWritten` has no matching client confirmation. This sequence was exercised on macOS and Windows for ordinary JIT, ReadyToRun, composite ReadyToRun and Native AOT on both runtimes, ten new processes per configuration.

[![PerfView lists the startup phase events in order. The second submit reaches AckWritten without another client-proof event.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-s2-detail-89eb1c8ec1fd.webp)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-s2-2x.webp)

PerfViewRead the event occurrences on the right from top to bottom. The second submission reaches `AckWritten` and has no later client-proof marker.

On one ordinary .NET 11 Mac run of the marked application, the runtime had emitted 248 method compilation-start events by `ListenerReady`. By the first `AckWritten` it had emitted 706\. On the native build, the program emitted the same named application marks and the JIT counter stayed at zero. That locates work the listening-only definition would hide. One event can describe anything from a small getter to a large method. Subtracting the counts gives a number of events, with no conversion to time.

dotnet-countersThis live counter follows an independent instance. The client verifies the job separately, so the counter has its own observation window. [Full recording](https://devinside.cloud/content/media/2026/11/how-dotnet-runs-08-s3.mp4)

Use the call stack to choose where to investigate next. Work beneath `StartAsync` belongs to bringing up the host. Work beneath `ExecuteAsync` in the submit handler belongs to writing this response. For time spent receiving and checking those bytes, inspect the client. [EventPipe diagnostics in .NET](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe?ref=devinside.cloud).

[![Visual Studio links the ClientReportedVerified event to the separate endpoint called after the client checks its response.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-s4-detail-d716e95117aa_o.webp)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-s4-2x.webp)

Visual Studio Insiders`AckWritten` comes from the submit handler. `ClientReportedVerified` comes from a separate endpoint reached after the client checks the response.

## Choose the observer for the part of startup you need to explain

Suppose a new replica is already healthy when the first customer reports a problem. Start with that customer’s response. If its ID or name is wrong, follow the submit handler and its acknowledgement. If the response is correct but arrived late, repeat a direct-first submission and a health-first submission in separate fresh processes. A probe can exercise part of startup before the job arrives. Which part of that wait could the receiver’s file tool actually see?

Use the client’s checked result as the reference. Select an observer below and read both ends of its line. The acknowledgement (ACK) send is the server’s socket operation. A line spanning that point means that collection was under way. Only the Linux trace identified the send carrying this particular job.

Observation windows

### The file tools cover different parts of the first request

Launch Debug break Listening ACK send Client check Stop request Client checklaunch to checked job Linux · stracelaunch to ACK send Windows · CDBbreak to client check Mac · File Activitylaunch to recorder stop Selected observation HTTP 202 · ID 1 · rebuild-index 

1. Follow one direct-first job from launch through listening to the complete response. The client checks status, Location, ID and name. No health probe precedes this POST.
2. Run the API under strace. Match the socket send carrying the expected JSON, then count open-family calls up to that send. The client still has to receive and validate it.
3. CDB, the Windows console debugger, sees named file-open calls after its initial breakpoint. Earlier loader opens are outside the window. Retain the records delivered by client verification.
4. Launch the API under Instruments File Activity. After the client checks its first POST, request recorder stop. These file events contain no response payload to identify the matching send.

Milestones show event order without a time scale. The breakpoint belongs to Windows and the recorder stop to macOS. Each count was reproduced in three launches per mode on that receiver. See the Linux and Windows `files` reports and Mac `files-at-ack` reports under `part08` in the ZIP.

The selected counts come from the .NET 11 API builds. Compare candidates within one recording window. On Linux the ordinary calls named 159 distinct path strings and the native calls named 48\. Individual ReadyToRun matched the ordinary counts. Composite produced 206 calls and 155 path strings. Some opens can fail and several can name the same file. Comparing the Linux and Windows totals as a storage-speed score would also count different operations over different intervals.

Choose the next investigation from the gap you still have. For a delay between listening and the first handled job, keep the client marks and inspect the application’s submit events. To identify files requested during startup, use the receiver’s file observer and report its start and stop conditions. Opening a file can succeed while all the pages the application needs are already in memory. To attribute the delay to storage, collect evidence of physical reads or faults that required I/O during the affected interval. The captures above leave page residency uncontrolled. [When the Windows initial breakpoint occurs](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/initial-breakpoint?ref=devinside.cloud) · [Linux system-call tracing](https://strace.io/?ref=devinside.cloud) · [How Instruments distinguishes logical filesystem activity from physical I/O](https://developer.apple.com/documentation/xcode/reducing-disk-writes?ref=devinside.cloud).

## Which request supplied the p95 on Ravi’s slide?

Return to the proposed 100-request test. One fresh process serves POST #1 through POST #100\. Even if the timer starts before each send and every acknowledgement is correct, the journal has had only one first submission. Sorting the hundred values erases that distinction. Ravi started his timers after the health check, so none includes process launch. If the first POST is the slowest, it ends up at rank 100\. The point labeled p95 comes from rank 95, a later customer who arrived after startup.

You can catch the mistake before measuring a millisecond. In the ZIP, open `results/mac/part08/net11.0-followup/runs.jsonl`. The ordinary build has one `launch`, one `listening` line and three verified acknowledgements with IDs 1, 2 and 3\. In `net11.0-direct/runs.jsonl` the corresponding process has just ID 1\. To answer the first caller’s question, keep one first response per launch. Keep the later IDs together with the process that served them when asking how the route behaves after its first call.

The historical November 21 course file lets Dana test the effect of pooling the requests. She keeps each measured duration and changes only which requests enter the calculation. Use only its ordinary .NET 11 build on the shared, loaded Mac. There were 20 processes, each with one first POST and 32 follow-ups. Each POST opened a new loopback connection. The clock started before the connection and stopped after the complete body arrived. The client then checked the status, location, ID and name. Which row below would you use for a direct first POST after the listener opens?

__Historical shared-host sample · JIT · request start to complete body__
| Requests included              | n   | p50 (ms) | p95 (ms)  | p99 (ms) | Max (ms) |
| ------------------------------ | --- | -------- | --------- | -------- | -------- |
| First POST in each process     | 20  | 70.36    | **96.85** | 97.00    | 97.00    |
| Later POSTs in those processes | 640 | 0.72     | 2.21      | 10.90    | 12.57    |
| All POSTs pooled               | 660 | 0.73     | **6.22**  | 72.01    | 97.00    |

To reproduce the table, select `net11-jit` from `lab-carryover/startup-timing-2026-11-21/results-2026-11-21-e05-timing.json` in the download. Take `first_request_ms` once per process and keep each process’s `repeated_ms` values for the second row. The third row combines both lists.

Every first POST took at least 45.83 ms in that historical sample. The 640 later requests fill the fast end of the pooled list. Its p95 selects item 627, so the number on the slide is smaller than the time *any* first caller spent on its POST. The first row answers the question about the first request *after listening*. To include the caller’s wait for process launch as well, select the separate launch-to-response interval for each process. The shared-host numbers explain the error in the release slide. Intake still needs its own timing data on a quiet receiver.

Use the slider to change the study design. Rank 1 is the fastest eligible first response. The nearest-rank method rounds `0.95 × n` and `0.99 × n` upward. What changes if Ravi spends his hundred requests on a hundred fresh launches instead?

Explorable

### A hundred POSTs can give you just one first caller

POSTs sent100 First POSTs1 Startup p95rank 1 of 1 Startup p99rank 1 of 1 One first POST per process.Rank 1 is fastest.Ties can share a duration. 

1. Send a hundred jobs to one process. Only its first POST qualifies, so both apparent startup percentiles point to the same observation.
2. Send one job per fresh launch. With three processes, either tail label selects the slowest of three first responses.
3. Five fresh first callers give five eligible observations. Both reported tail percentiles still use the last sorted value.
4. Ten fresh processes separate the median from the tail ranks. The slowest first caller still supplies both tail positions.
5. At thirty fresh processes, the second-slowest first response supplies p95\. The slowest supplies p99.
6. Spend the original hundred requests on a hundred processes. Now p95 uses the ninety-fifth first caller in sorted order, and p99 uses the ninety-ninth.

Illustrative launch designs. Ranks are derived from `distribution()` in `bench/harness/startup.py`.

For a quiet-receiver study, put each candidate build in every round, shuffle their order with a recorded seed and keep the round IDs. A neighbor’s activity or cached files can otherwise favor whichever candidate always runs last. The driver can resample matched rounds to estimate uncertainty in a *difference of medians*. For a first-caller p95, use the first-call rows. With 30 launches, the sample p95 is the second-slowest result. A tight interval around the median difference still leaves uncertainty at the tail. The quiet-receiver timing mode supports the Linux and Windows CPU assignments described in the archive.

#### Approve on health alone

```bash
curl --fail http://127.0.0.1:5080/health
```

The health handler answered. A deployment can use this signal to allow traffic to reach the replica. Dana still needs to know what happens on the first real submission.

#### Check what the first routed job gets

```bash
python3 bench/harness/startup.py verify \
  --manifest cells.json --probe none --shape api \
  --verify-posts 3 --out first-then-repeat
```

The Part 8 README shows how to prepare `cells.json`. For each build, `verify` records one launch and three job IDs. Run the health-first control separately when that matches production routing.

Dana can now make a routing decision. Keep the inexpensive readiness probe for the load balancer and exercise a named job through a disposable release candidate. Posting to the live journal on every health check would create jobs. [Kubernetes readiness probes and traffic routing](https://kubernetes.io/docs/concepts/workloads/pods/probes/?ref=devinside.cloud).

Write the release condition as “at least 95% of attempted first callers receive the correct job acknowledgement by the deadline.” In an illustrative rollout log, 28 on-time acknowledgements and two timeouts in 30 fresh launches would give 93.3% on time. The sample would miss the condition even if all 28 successful replies were fast. The supplied harness preserves an erroneous row and stops the run, so the team can inspect the failure before running the full study again.

## Container creation and process launch have different starting points

Suppose the request arrives while the scheduler is adding a replica. With the image already on the node, the runtime may create the container from local layers. On a node missing a layer, it must fetch the missing content before starting this process. The customer can be waiting through both events. A clock started at process launch misses all of the preceding queue, pull and create time. Keep the request arrival, image availability and launch markers if that is the experience in the release promise.

Test the same pinned image on a receiver that already has its layers and on one where a required layer must be fetched. Keep the groups separate. Record image-transfer evidence for each. Within either group, leave file-page residency marked unknown unless you measured it. The image inventory identifies what is stored on the node. Residency describes what is in memory when the next process starts. The archived container checks created containers and verified image identities, with no timed pull or cold-page claim.

Even with the same image on the node, a CPU quota changes the resources available to the new process. The container control mounted the same published API read-only and assigned 0.5, 1 and 2 CPUs, one container at a time. Its client ran over loopback inside that container. It read the Linux control group's `cpu.max` file, verified the first 202 and checked the program hash. In the half-CPU case the file contained `50000 100000`: up to 50,000 microseconds of CPU per 100,000-microsecond scheduling period. A quota describes capacity. It does not predict the time spent on this request. [Docker CPU resource constraints](https://docs.docker.com/engine/containers/resource%5Fconstraints/?ref=devinside.cloud).

Docker · .NET, Linux Arm64Read cpu.max beside each assigned quota. Both containers run the same API binary and return the submitted name. [Full recording](https://devinside.cloud/content/media/2026/11/how-dotnet-runs-08-s5.mp4)

The native Arm64 and x64 Linux receivers both completed the correct submission under all three quotas. Those are six useful checks of the test environment. To claim a first-response improvement at half a CPU, the next study must use that quota on a quiet receiver, exercise the same first request repeatedly in new processes and retain the whole distribution. Timing a process with the image already present also leaves image pull and create outside the answer.

## Should the export CLI move from .NET 10 to .NET 11?

Suppose Intake’s nightly pipeline launches `intake export` once per partner document. The API can serve its second request in an existing process. The script must start the CLI again for its second document, even with warm executable pages.

Compare the same operation on .NET 10.0.15 and 11.0.0\. Both candidates are framework-dependent Release builds using the ordinary JIT and `BoundedExport=true`. The launcher uses the installed runtime pinned for its candidate. Pass `R&D <night> Łódź` as one argument. Both functional runs emitted this XML. Which name will the partner recover? [Framework-dependent publishing](https://learn.microsoft.com/en-us/dotnet/core/deploying/?ref=devinside.cloud#publish-as-framework-dependent).

```xml
<job><name>R&amp;D &lt;night&gt; Łódź</name></job>
```

Both processes exited with code zero. The parser recovered `R&D <night> Łódź` exactly, including the accented characters. The clip shows the same check with the shorter name from the original four-mode exercise. A blank document, a wrong name or a timeout counts as a failed partner delivery.

.NET · macOS Arm64For check, read the policy decision. For export, read the name recovered from the XML, including its reserved characters. [Full recording](https://devinside.cloud/content/media/2026/11/how-dotnet-runs-08-s6.mp4)

### Separate the caller’s wait from its cause

The migration driver, `bench/migration/cli_worker.py`, starts its clock immediately before creating the published process. It consumes stdout, checks for exit zero, decodes UTF-8 and parses the XML. Only a matching `job/name` earns the end timestamp. The caller’s parsing time is included in elapsed time. CPU time and peak working set come from the child process.

For diagnosis, `--idle` starts the same CLI, prints `Ready` and exits before `PartnerExport.Write`. Subtracting the two p99s would mix different processes and output paths. To isolate the writer, mark entry into `Main` and both ends of writing in an instrumented run. Use the ordinary launch-to-checked-XML path for the release decision.

### Read the export p99 one pair at a time

On a shared Windows Server 2022 host with an AMD EPYC 7502P, the client and CLI had separate CPU assignments. Docker and WSL remained running. Across the twelve CLI measurement windows, mean whole-station disk traffic ranged from 13.71 to 61.21 MiB/s, including the exports.

Six blocks paired the two runtimes, three in each order. Per block and runtime, one excluded warmup preceded 100 fresh processes with warm files. All **600 measured exports per runtime** returned the correct XML and exited successfully. In a block of 100, p99 is the second-slowest export. Follow one line across the top panel. A downward line means the client waited less on .NET 11\. Do all six lines go down?

[![Six Windows block pairs. The median block p99 falls from 67.73 to 57.07 ms, with four pairs falling and two rising. Child CPU per export falls from 49.77 to 46.56 ms at the median, and the median block peak working set changes from 17.20 to 17.31 MiB.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-migration-cli-caf5d755e649.svg)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-migration-cli-caf5d755e649.svg)

Each line joins the same block’s .NET 10.0.15 and 11.0.0 results. Diamonds show the median across blocks. CPU is child-process time per correct export. Each memory point is the largest lifetime working set of the 100 measured processes in that block.

The median of the six block p99s was **67.73 ms on .NET 10.0.15 and 57.07 ms on .NET 11.0.0**. Subtract .NET 10’s p99 from .NET 11’s within each block. The median paired change was **−7.96 ms**. The six candidate-to-baseline ratios ranged from 0.724 to 1.083, with a median of 0.871\. The candidate’s tail was shorter in four blocks and longer in two. These shared-host runs did not establish the study’s required repeatable 10% reduction. See `results/migration/cohorts/post-recovery-shared-host/` for the raw exports and paired analysis.

### Turn launch frequency into a batch budget

Suppose, as a planning example, the pipeline must deliver 1,200 documents serially in ten minutes each night. Reserve two minutes for queueing, retries and other pipeline steps. That leaves 480 seconds for 1,200 correct exports, an average allowance of **400 ms per export**. A 1 ms change in mean launch-to-checked time would change the expected serial work by 1.2 seconds per night. A 1 ms change in p99 tells Dana about the tail and cannot be multiplied that way.

Time the complete nightly batch on the deployment receiver. Queue gaps, retries and overlapping launches can change its finish time. If the deadline is per document, count every attempt and check how many correct exports arrived on time.

### What if the scheduler starts one importer per file?

Suppose a motor controller delivers 37 temperatures now and a full day of 86,400 readings overnight, one per second. Dana schedules a .NET 11 command for each file. Both versions open the CSV and parse it into the same integer array. Only the final count changes. The single instruction, multiple data (SIMD) counter compares four temperatures at a time on the M3 Max. Will the caller get the answer sooner?

On a shared Mac with recently accessed input files, each command ran in a fresh process. The parent started the clock just before launch and stopped after the child exited successfully and returned the expected count above 85 °C. All 32 answers were correct. Read the median (p50) first. With eight launches per row, the nearest-rank p95 and p99 both select the slowest launch.

__M3 Max, macOS Arm64 · process launch to checked count, in milliseconds__
| Readings and counter | n | p50   | p95   | p99   | Max   |
| -------------------- | - | ----- | ----- | ----- | ----- |
| 37 · scalar          | 8 | 39.86 | 53.41 | 53.41 | 53.41 |
| 37 · SIMD 128        | 8 | 40.17 | 49.91 | 49.91 | 49.91 |
| 86,400 · scalar      | 8 | 45.06 | 51.52 | 51.52 | 51.52 |
| 86,400 · SIMD 128    | 8 | 44.42 | 57.58 | 57.58 | 57.58 |

For the small file, the 128-bit counter finished first in three of eight pairs. For the full day it won six pairs, with a median scalar-to-vector time ratio of 1.035\. Changing the scheduled command called for a ratio of at least 1.05 and seven wins in eight pairs. Neither file met both conditions. For this job Dana keeps the scalar counter. [Part 9 measures opening and parsing the same files once the process is running](https://devinside.cloud/how-dotnet-runs-09-steady-state-jit-vs-native-aot/#temperature-file-import).

The download’s `results/temperature-import/startup/README.md` shows how to repeat those launches. Dana can also change how often the scheduler starts the importer.

## How many ready files make one launch worthwhile?

Eight sensor files, each containing 37 readings, are already in the nightly inbox. Dana can run a separate command for each file in turn, or pass all the paths to one command. Both versions open each CSV, parse its decimals and count readings above 85 °C with the same scalar loop. They print one count per file in argument order. How many files does Dana need before sharing a process pays off?

The caller timed the whole group from just before its first launch until it had checked the final exit and every count. The same .NET 11 program ran on the M3 Max on macOS, EPYC 7502P on Windows Server and Xeon W-2295 on Ubuntu. All three were shared machines with recently read files. Each group size was tried eight times in each mode, alternating which went first. Start at one file, where both commands are identical, then compare the two-file row.

[![Median time to finish 1, 2, 3, 4 or 8 ready files on M3 Max, EPYC and Xeon. Two files are the first clear saving on all three. For eight files the single process finishes in 40 to 53 ms, versus 315 to 417 ms for separate launches.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-cli-batches-fe50fd1e5fc8.svg)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-cli-batches-fe50fd1e5fc8.svg)

One process per file and one process for the group use the same .NET 11 importer. Dana’s rule for a worthwhile change was a median paired time saving of at least 10 ms, a median speed ratio of at least 1.05 and a win in at least seven of eight pairs. The ratio divides separate-launch time by grouped time within each pair.

**Two ready files were enough on all three machines.** Grouping won all eight pairs at that size. It saved a median 37.5 ms on the M3 Max, 40.7 ms on EPYC and 25.5 ms on Xeon, calculated within pairs. At one file even the identical Xeon commands produced different medians. They provide a control for the variation between launches. At eight files the Windows scheduler got all eight answers in 42.8 ms at the median, compared with 347.1 ms for eight launches.

Grouping also changes retries. In the sample’s error test the importer prints `12` for the first file, encounters a malformed second file and exits with code 1\. A scheduler that acts on each line needs to remember which files it has handled before retrying the group.

To try it on your receiver, open `bench/temperature/BatchImport` in the download. These commands create eight files and submit the first two together. On Windows, use `py -3` for `python3`.

```bash
python3 -m zipfile -e ../batch-kit.zip kit
python3 fixtures.py packets
dotnet --fx-version 11.0.0 kit/BatchImport.dll packets/sensor-01.csv packets/sensor-02.csv
```

You should get `6` then `9`, one count per line. Run `python3 batches.py kit/BatchImport.dll packets --output my-batch-run` to time both strategies. Compare your matched runs with `results/temperature-batching/pairs.csv` in the download. A live alarm starts its clock before there is a second file to pass to the command.

## Should the first alarm wait for another sensor file?

Suppose a motor alarm must reach the caller within 100 ms of a file becoming available. That is Dana’s example deadline. Each file contains 37 temperature readings. The clock starts when the producer renames a finished file into the inbox. It stops when the caller checks the file ID and the count above 85 °C on the importer’s output line. Each result can arrive while the process is still running. Every process must also exit cleanly.

The producer keeps its own schedule even when the importer falls behind. It releases one file every 120 ms, four files 3 ms apart every 180 ms, or a short stream with one file every 8 ms. The M3 Max and EPYC ran all three profiles. The shared Xeon ran the first two. Its CPU limit stopped one additional run before it returned a usable result. These are local files, signaled directly to the scheduler on release. Writing the CSV, detecting it through a filesystem watcher and notifying a person fall outside this clock.

One policy launches a fresh CLI per file. The next three launch one CLI for up to eight files. *Drain now* takes whatever is ready. The 10 ms and 40 ms timers start at the oldest waiting file’s actual release. Eight files fill the group early. If the preceding command was still busy when the timer expired, dispatch can happen later. The final policy keeps one scalar importer running and sends each path immediately. It has already started, signaled ready and returned one checked result before the first measured arrival.

Start with a file that has no neighbor within the timer. Can a 40 ms wait save a launch? Then read the four-file bursts, where the fourth file is due 9 ms after the first.

[![99th-percentile time from file release to checked alarm for five scheduling policies. On M3, waiting 40 ms for isolated files raises p99 from 43 to 103 ms. A 10 ms wait for bursts lowers it from 92 to 51 ms.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-arrival-latency-abeac9eb2321.svg)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-arrival-latency-abeac9eb2321.svg)

Each complete comparison pools four runs of 32 files. Sort 128 individual waits and p99 is the second slowest. In the Xeon burst panel, only *Drain now* reached 128 files. Each other policy completed three runs of 32, where p99 is the single slowest file. Several files from a burst can share a launch.

On the M3, draining immediately and waiting 40 ms both needed 128 launches for 128 isolated files. The timer raised p99 from **43.3 to 102.6 ms** and two files missed Dana’s 100 ms deadline. The delivered rate barely changed, from 8.53 to 8.43 alarms/s.

In M3 bursts, draining immediately took two launches per burst. Waiting 10 ms let one process take all four files, halved the launches and brought p99 down from **91.8 to 50.9 ms**. Waiting 40 ms still took one launch per burst. Once the fourth file had arrived, the longer timer bought no further saving in launches. On the Xeon, draining immediately missed the deadline for 27 of 96 files in the three matching burst runs. Waiting 10 ms brought all 96 in on time.

Now look at how many checked alarms the caller received each second. With 120 ms between files, even an instant answer would leave the worker idle until the next arrival. When a file arrives every 8 ms, can the importer empty its queue as fast as it fills?

[![Checked alarms per second from first file release to last answer. The sparse feed delivers about eight per second. On dense Windows EPYC arrivals, draining ready files delivers about 103 per second versus 25 with a separate process per file.](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-arrival-throughput-59f5acfcc66e.svg)](https://devinside.cloud/content/images/2026/11/how-dotnet-runs-08-temperature-arrival-throughput-59f5acfcc66e.svg)

Divide the number of checked results by the sum of the observed run durations, from first actual release to last checked line in each run. No idle gap follows the last alarm. A sparse stream only exposes the work the producer sent.

At 8 ms intervals on the EPYC, a separate process per file delivered **24.6 alarms/s**. Its p99 was about 1.09 s. Draining up to eight ready files at once delivered **102.6 alarms/s** with a p99 of 79.2 ms. While one command was running, the next group formed in the queue. No extra timer was needed. In these trials the throughput gain and the penalty for waiting appeared under different arrival patterns. [Part 9 follows the backlog in one of those runs](https://devinside.cloud/how-dotnet-runs-09-steady-state-jit-vs-native-aot/#temperature-arrival-throughput).

For an isolated alarm, start immediately. For a burst, try a timer long enough to catch its neighbors and check the deadline on its oldest file. If startup itself uses too much of the deadline, try the prestarted worker. Its EPYC burst p99 was 0.7 ms with the same file reads, parsing and checks. Include its [idle memory](https://devinside.cloud/how-dotnet-runs-10-memory-working-set-heap-retention/#resident-alarm-worker) and its [restart and acknowledgement behavior](https://devinside.cloud/how-dotnet-runs-11-the-release-memo/#alarm-policy-release) in the release decision.

Open `results/temperature-arrivals/explorer.html` in the download to enter your own deadline and inspect all 32 individual waits from a selected run. To run one burst on your machine, start in `bench/temperature/ArrivalImport` and choose a new output filename. On Windows, use `py -3` for `python3`.

```bash
python3 -m zipfile -e ../arrival-kit.zip kit
python3 arrivals.py kit/ArrivalImport.dll --profile burst --policy wait10 --block 1 --out burst-wait10.json
```

### When does the notification service have the alarm?

Suppose the operator’s deadline ends when a second service has saved the notification. On the M3 Max, the recipient closed the connection after every eighth file’s first commit. With one attempt per file, all 128 notifications were on disk. File arrival to first commit had a p99 of **18.6 ms**. The sender could confirm only 112 files, too few for a confirmation p99 across all 128\. [See how part 11 checks the database against the inputs](https://devinside.cloud/how-dotnet-runs-11-the-release-memo/#durable-notification-delivery).

Put the recipient on the Windows EPYC and the time spent waiting to send can dominate. At 27.5 files/s, opening one connection per file produced a first-save p99 near 7.6 s in the original lost-reply trial. In a fresh comparison the serial sender took 2.13 to 2.21 s. Allowing up to eight single-file requests in flight brought it to **82 to 154 ms** for the same arrivals. Starting the clock at HTTP dispatch would have hidden the queue that made the serial sender slow. [Part 11 compares connection reuse, parallel requests and batching, then checks every retried file in the recipient’s database](https://devinside.cloud/how-dotnet-runs-11-the-release-memo/#transport-policy).

A long-lived worker changes the finish line. Queue a job, launch the worker and parse the final `1.xml`. Check the API for pending or failed exports. For the web console use the first useful journal page from part 4.

A correct answer is required for every timed attempt. A timeout or invalid result still belongs in the decision record and blocks a clean comparison for that case.

- Write down the caller, triggering event and first correct result before selecting the tool.
- Keep a whole-artifact identity and the actual response, exit value or parsed file with each attempt.
- Separate a fresh process from a known-cold filesystem, and leave the first round visible.
- Keep health-first, direct-first and repeated requests as separate populations.
- Use the receiver's actual capacity and distribution path. Report n, p50, p95, p99, maximum and failures when the timing conditions are available.

## Run the published files and keep the observations

Start from the archive root with `python3 tools/part08.py demo --framework net11.0 --work artifacts/part08`. Windows readers can use `py -3`. The default builds the ordinary API, worker and CLI with the bounded partner writer and verifies all four operation shapes. Use `--framework net10.0` for the other runtime. The readme in `src/Part08.Start` gives the four-mode comparison, correct manifest format and optional phase, host, filesystem and memory studies. The timing command requires a named quiet receiver and uses an exclusive measurement file.

Lesson 05 of the companion course follows one service start. The article's additional experiments are the two first-request designs, the proof sent back by the external client, the worker's externally read document and the cross-platform file observations. For the wider measurement design, see [a measurement contract for the same .NET service](https://devinside.cloud/same-service-different-numbers-a-measurement-contract-for-net/) and [what telemetry costs before sampling](https://devinside.cloud/the-observer-effect-a-small-net-telemetry-lab/).

## Further reading

- [The .NET generic host and application lifetime](https://learn.microsoft.com/en-us/dotnet/core/extensions/generic-host?ref=devinside.cloud)
- [Host tracing and environment settings](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables?ref=devinside.cloud)
- [Collecting EventPipe traces with dotnet-trace](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace?ref=devinside.cloud)
- [Docker container CPU and memory constraints](https://docs.docker.com/engine/containers/resource%5Fconstraints/?ref=devinside.cloud)
- [GetProcessMemoryInfo and Windows process memory counters](https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo?ref=devinside.cloud)
- [The strace diagnostic utility](https://strace.io/?ref=devinside.cloud)

Dana records two separate decisions for the API. The probe can qualify the replica to receive traffic. The API’s deadline still needs first-caller samples from the intended receiver. Both CLIs delivered the XML. The nightly batch deadline remains open. For the worker, delivery ends when the partner can read the file.

Suppose one release wins the first-caller budget on the intended receiver. Once all the processes are serving work, which one spends less CPU per completed job?

**Series** · [How .NET Runs Your Code](https://devinside.cloud/how-dotnet-runs/), part 8 of 11\. Previous · [Build host, target, receiver](https://devinside.cloud/how-dotnet-runs-07-build-host-target-receiver/). Next · [CPU per completed job](https://devinside.cloud/how-dotnet-runs-09-steady-state-jit-vs-native-aot/)