Add Server-Timing instrumentation and optimization plan#322
Draft
Add Server-Timing instrumentation and optimization plan#322
Conversation
Introduce RequestTimer for per-request phase tracking (init, backend, process, total) exposed via Server-Timing response headers. Add benchmark tooling with --profile mode for collecting timing data. Document phased optimization plan covering streaming architecture, code-level fixes, and open design questions for team review.
Introduce RequestTimer for per-request phase tracking (init, backend, process, total) exposed via Server-Timing response headers. Add benchmark tooling with --profile mode for collecting timing data. Document phased optimization plan covering streaming architecture, code-level fixes, and open design questions for team review.
Collaborator
|
@prk-Jr Have you seen this? https://www.fastly.com/blog/profiling-fastly-compute-applications I don't think we need to make changes to profile |
RequestTimer and Server-Timing header were premature — WASM guest profiling via profile.sh gives better per-function visibility without runtime overhead. Also strips dead --profile mode from benchmark.sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RequestTimer(crates/common/src/request_timer.rs) that tracksinit,backend,process, andtotalphases and emits aServer-Timingresponse headermain.rsandpublisher.rsfor the publisher proxy hot pathscripts/benchmark.shwith--profilemode to collect and report Server-Timing data, TTFB/TTLB stats, and load test resultsOPTIMIZATION.md— phased optimization plan for team review covering:stream_to_client()streaming architecture (needs spike for#[fastly::main]compatibility)Test plan
feat/optimize-tsto stagingBENCH_URL=<staging-url> ./scripts/benchmark.sh --profileand verify Server-Timing headers appear