# Benchmarks Measured on 2026-10-27 with the release build of this tree: the `micro-dsp` server and the `mdsp-sim` simulator on one laptop, talking over loopback. Every number below was read from the simulator's reports, the server's `/metrics` and admin API, or the system tool named next to it. Nothing is extrapolated. ## Machine | | | | --- | --- | | Model (`sysctl -n hw.model`) | Mac16,12 | | CPU (`machdep.cpu.brand_string`) | Apple M4 | | Cores (`hw.ncpu`, `hw.perflevel0.physicalcpu`, `hw.perflevel1.physicalcpu`) | 10: 4 performance, 6 efficiency | | Memory (`hw.memsize`) | 16 GiB | | OS | macOS 27.0.1 (26A434), arm64; `kern.ipc.somaxconn` 128, `net.inet.tcp.msl` 15000 ms | | Toolchain | rustc 1.97.1 (8bab26f4f 2026-07-14) | Not an isolated host: a desktop session with Docker Desktop and a browser running, load average between 2.7 and 3.8 before the runs, and the simulator sharing the same 10 cores with the server. ## Build Release profile of the workspace: `lto = "fat"`, `codegen-units = 1`, `debug = false`. ```sh cargo build --release -p mdsp-server -p mdsp-sim ``` The first release build of both (208 crates) took 3 min 54 s wall time, 416.7 s user; rebuilds after server changes took 2 min 14 s to 2 min 52 s, most of it fat LTO. Binary sizes: `micro-dsp` 27,003,024 bytes, `mdsp-sim` 5,955,952 bytes. ## Server setup `config/example.toml` unchanged except one line, changed in a copy because nested tables cannot be overridden from the environment: `[supply.ivt] allow_documentation_ips = true`. The simulator draws device IPs from the RFC 5737 documentation ranges, which the IVT pre-filter otherwise blocks as reserved addresses. Everything else is the example: SQLite store, product seeds from `config/seed`, JSON logs at `info`, events flushed every 10 s, the supply policy enforcing schain presence and structure, AdCP and AAMP enabled. ```sh RUN=$(mktemp -d) sed 's/^allow_documentation_ips = false/allow_documentation_ips = true/' \ config/example.toml > "$RUN/bench.toml" MDSP_TOKEN_KEY=$(openssl rand -base64 32) \ MDSP_TOKEN_KEY_PREVIOUS=$(openssl rand -base64 32) \ MDSP_ADMIN_KEY=bench-admin-key-0123456789 \ MDSP_SERVER_BIND=127.0.0.1:8080 \ MDSP_STORE_SQLITE_PATH="$RUN/micro-dsp.db" \ MDSP_EVENTS_SPOOL_DIR="$RUN/spool" \ target/release/micro-dsp --config "$RUN/bench.toml" ``` The catalog was then created through the admin API: one campaign (budget 1,000,000 USD, pacing `asap`), four approved creatives with an IAB category (requests with `bcat` refuse uncategorized creatives): hosted video 30 s (1080p and 360p renditions), hosted video 15 s, a VAST tag of 30 s served as a Wrapper, hosted audio 30 s; and two line items: video with first-price auction pricing up to 40 CPM, and audio at a fixed 14 CPM. No frequency caps, no deals, no ARTF agents. ## Request templates The simulator's four built-in templates, randomized per request (ids, users, geography, floors with 25 percent jitter, PMP on half the impressions). Sizes are bytes of the stored file, of the same request compact as the simulator sends it, and of the server's answer to that compact request (uncompressed; the simulator sends no `Accept-Encoding`). | Template | Kind | File | Compact request | Response | `adm` | | --- | --- | --- | --- | --- | --- | | `audio-stream` | app audio | 1,622 | 1,234 | 7,570 | 6,193 | | `ctv-live-midroll` | CTV live mid-roll pod | 1,795 | 1,278 | 6,831 | 5,448 | | `ctv-pod` | CTV pre-roll pod with PMP | 2,484 | 1,771 | 7,490 | 6,120 | | `web-video` | web instream | 1,680 | 1,216 | 7,697 | 6,307 | ## Conformance: `verify` ```sh mdsp-sim verify --target http://127.0.0.1:8080/openrtb2/bid --samples 5 ``` | Template | Requests | Bids | VAST documents | RTBlint and VASTlint errors | Warnings | | --- | --- | --- | --- | --- | --- | | `audio-stream` | 6 | 5 | 5 | 0 | 0 | | `ctv-live-midroll` | 6 | 5 | 5 | 0 | 0 | | `ctv-pod` | 6 | 5 | 5 | 0 | 0 | | `web-video` | 6 | 5 | 5 | 0 | 0 | Passed. VASTlint reported only info findings (`VAST-4.1-mezzanine-recommended`). ## Auctions with delivery: `auction` ```sh mdsp-sim auction --target http://127.0.0.1:8080/openrtb2/bid --count 2000 \ --concurrency 8 --seed 7 --rewrite https://track.example.com=http://127.0.0.1:8080 ``` | | | | --- | --- | | Auctions | 2,000 in 0.63 s, all with a bid | | Errors | 0 HTTP, 0 invalid, 0 timeout, 0 transport | | Outcome | 1,791 won (89.55 percent), 209 lost to a higher bid (loss code 102) | | Mean clearing price | 30.1501 CPM | | Bid latency | p50 0.370 ms, p90 1.035 ms, p99 9.007 ms, p99.9 17.711 ms, max 25.455 ms, mean 0.723 ms | | RTBlint | 0 errors, 0 warnings | | VASTlint | 0 errors, 0 warnings, 1,522 infos | | Notices and pixels fired, 0 failed | nurl 1,791 · burl 1,736 · lurl 209 · impression 1,716 · start 1,680 · firstQuartile 1,569 · midpoint 1,516 · thirdQuartile 1,464 · complete 1,393 · error 20 · click 3 | Read back from `GET /admin/delivery` once the run sequence ended: 1,791 wins, 1,736 impressions (one billable event per bid, the `burl` or the VAST impression, whichever came first), 209 losses, 1,680 starts, 1,393 completes, 20 errors, 3 clicks, and 52.384645 USD of spend at the clearing prices the exchange substituted. The simulator's own spend figure (53.9988) sums the clearing price of every won bid, including the 3 percent of wins its delivery model leaves unrendered and therefore unbilled. The bid counter was 1,110,417: the bids of verify, auction, load run 1 and the closed-loop run (20 + 2,000 + 399,606 + 708,791). ## Load: `load`, 20 seconds open loop ```sh mdsp-sim load --target http://127.0.0.1:8080/openrtb2/bid --rate 20000 --duration 20s \ --max-in-flight 256 --seed 42 ``` Run 1 ran in the sequence above on the same server; runs 2 and 3 each on a freshly started server with the same catalog. Load mode fires no notices, so every bid keeps its budget reservation for the reservation TTL. `dropped` counts requests the simulator did not send because 256 were already in flight. | Run | Requests | Achieved | Bids | Errors | Dropped | p50 | p90 | p99 | p99.9 | Max | Mean | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | 399,606 | 19,978.9 qps | 399,606 | 0 | 393 | 1.116 ms | 1.743 ms | 2.165 ms | 14.727 ms | 33.695 ms | 1.163 ms | | 2 | 399,883 | 19,993.3 qps | 399,883 | 0 | 100 | 1.111 ms | 1.725 ms | 2.097 ms | 12.791 ms | 18.335 ms | 1.138 ms | | 3 | 399,844 | 19,990.8 qps | 399,844 | 0 | 154 | 1.108 ms | 1.730 ms | 2.149 ms | 14.855 ms | 25.919 ms | 1.155 ms | Every request bid. These latencies are client side: they include the simulator's scheduling, loopback TCP and HTTP on a shared CPU. The server's own handler time over the same windows, from the `mdsp_openrtb_bid_seconds` histogram (body read, decode, bid pipeline, encode), as the share of requests at or under each bucket: | Run | Mean | 50 us | 100 us | 250 us | 500 us | 1 ms | 2.5 ms | | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | 46.4 us | 61.89% | 97.30% | 99.70% | 99.97% | 99.99% | 100.00% | | 2 | 48.6 us | 52.17% | 97.65% | 99.71% | 99.98% | 100.00% | 100.00% | | 3 | 48.0 us | 57.38% | 97.05% | 99.61% | 99.96% | 99.99% | 100.00% | Mean time per bidder stage (`mdsp_bidder_stage_seconds`): | Run | gates | candidates | privacy | supply and IVT | checks | select | finalize | | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | 0.4 us | 3.5 us | 1.5 us | 3.8 us | 3.4 us | 1.9 us | 6.9 us | | 2 | 0.4 us | 3.7 us | 1.5 us | 4.1 us | 3.2 us | 2.0 us | 6.9 us | | 3 | 0.5 us | 3.9 us | 1.5 us | 3.6 us | 3.1 us | 2.1 us | 6.8 us | Finalize signs the token, renders the VAST, reserves budget and builds the response. Server resident memory (`ps -o rss`): 146,848 KiB before run 1 and 149,888 KiB after it; 178,832 KiB and 180,816 KiB after runs 2 and 3 on fresh servers. ## Load: closed loop, 64 workers ```sh mdsp-sim load --target http://127.0.0.1:8080/openrtb2/bid --concurrency 64 --duration 10s --seed 11 ``` | Requests | Throughput | Bids | Errors | p50 | p90 | p99 | p99.9 | Max | Mean | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 708,791 in 10.00 s | 70,874.7 qps | 708,791 | 0 | 0.803 ms | 1.359 ms | 2.703 ms | 8.415 ms | 51.551 ms | 0.890 ms | This is what the laptop sustains with the simulator and the server sharing it, not a server limit. The open-loop runs use 20,000 qps, under a third of it, so they measure service time rather than queueing. ## Method notes - Each phase starts after the client-side `TIME_WAIT` sockets of the previous one expire (`netstat -an -p tcp`): the auction mode leaves about 1,200 from its pixel burst, and macOS has 16,384 ephemeral ports and keeps `TIME_WAIT` for 30 s. - With these binaries but the default in-flight cap of 4,096, the same open-loop command collapsed: 139,456 requests in 22.38 s (6,231.9 qps achieved), 26,201 transport errors, 2,544 timeouts, 260,454 requests dropped, and 16,345 sockets in `TIME_WAIT` afterwards. An earlier attempt with the previous simulator build collapsed the same way (14,591 sockets in `TIME_WAIT`). The `/metrics` snapshot after the run failed to connect; in every run where one was taken, the handler histogram stayed under 25 ms. The likely sequence: a short stall lets thousands of requests pile up, the client opens a connection for each, the listen queue (capped at 128 by `kern.ipc.somaxconn`) overflows, the dropped SYNs are retried after 1 s, which is the simulator's request timeout, and the closed connections exhaust the ephemeral ports. The bounded cap keeps the client inside the connections it already holds. - `mdsp-sim` now keeps every connection its in-flight cap allows in its idle pool (`HttpClient::with_max_idle`) instead of 1,024, so a spike does not close connections that the next spike reopens.