perf(health): kill the 5s cold-start tax — no initial_delay default + fast-start probing - #143
Merged
Merged
Conversation
…fast-start probing Two changes that together took the php-fpm -> nginx dependency gate from 4.95s to 0.20s, and whole-container cold start (start -> first HTTP 200) from 6.15s to 1.33s median over 30 runs on the php-baseimages benchmark: 1. initial_delay no longer defaults to 5 seconds. The silent default made every monitor sleep 5s before its FIRST probe, so readiness waited out the delay even though php-fpm listens ~50ms after start. Unset now means probe immediately; an explicit initial_delay is honored. 2. Fast-start probing: until the first successful check after (re)start, probe every 100ms instead of the steady-state period. Failure semantics are unchanged - at most one failure is counted (and emitted) per period, the extra discovery probes are silent - so a never-up process is declared unhealthy on exactly the old schedule, while readiness is discovered within one probe interval. Rearm() gives restarted instances the same fast discovery. New test: a service listening 600ms after monitor start is discovered in <1s (was: one full period). Full suite, vet, gofmt, lint green.
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.
Benchmarking the images against the field surfaced that cold start was dominated by ONE thing: the health monitor slept a silent
initial_delaydefault of 5s before its first probe, so the php-fpm → nginx dependency gate waited out the delay even though php-fpm listens ~50ms after start.Changes
initial_delaydefault. Unset now means probe immediately; an explicitly configured delay is honored unchanged.Rearm()re-opens the window so restarted instances get the same fast discovery.Measured (php-baseimages benchmark, 2 CPU / 1 GiB)
Field context: ServerSideUp 1.2s, DIY fpm+nginx 1.8s, webdevops 2.1s — this moves cbox from last place to the front pack.
New test: a service that starts listening 600ms after the monitor is discovered in <1s (previously one full period). Existing threshold/liveness tests pass unchanged. gofmt/vet/lint/full suite green.