Skip to content

[tinker] Route uvicorn's access log to a plain handler instead of Rich - #11

Closed
avigyabb wants to merge 1 commit into
mainfrom
avi/stack-1-access-log
Closed

[tinker] Route uvicorn's access log to a plain handler instead of Rich#11
avigyabb wants to merge 1 commit into
mainfrom
avi/stack-1-access-log

Conversation

@avigyabb

@avigyabb avigyabb commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Stack 1/7. Independent of the rest.

RichHandler renders each access-log record through a rich Table, about 1.5 ms of event-loop CPU per HTTP request. Under rollout load that was 63% of the Tinker API server's CPU: profiling a 4096-sample run showed 12.5 s of its 19.9 s of server CPU inside rich.logging.emit. With a plain StreamHandler for uvicorn.access the same run takes 9.7 s and server throughput goes from 337 to 568 samples/s. Startup and error logging keep the Rich handler.

Measured with the load harness in stack 7/7 (skyrl/benchmarks/load_test_tinker_sampling.py).

Stack

  1. [tinker] Route uvicorn's access log to a plain handler instead of Rich #11
  2. [tinker] Forward samples with aiohttp instead of httpx #12
  3. [tinker] Keep an undelivered sample result alive for the SDK's retry #13
  4. [tinker] Survive completion bursts at the socket layer (accept backlog, keep-alive) #14
  5. [tinker] Encode forwarded sample results to proto once and serve them as-is #15
  6. [tinker] Decode vLLM completion bodies straight into numpy with pysimdjson #16
  7. [tinker] Load harness for the API server's sampling path at 131k concurrency #17

🤖 Generated with Claude Code

RichHandler renders every access-log record through a rich Table, about
1.5ms of event-loop CPU per HTTP request. Under rollout load that was 63% of
the Tinker API server's CPU: a 4096-sample run spent 12.5s of its 19.9s of
server CPU in rich.logging.emit. With a plain StreamHandler for
uvicorn.access the same run takes 9.7s and server throughput goes from 337
to 568 samples/s. Startup and error logging keep the Rich handler.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Avi Basnet <avigyabb@stanford.edu>
@avigyabb

avigyabb commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream: NovaSky-AI#2160

@avigyabb avigyabb closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant