perf: default MaxConnsPerHost to unlimited, fix zero-value semantics#918
Merged
perf: default MaxConnsPerHost to unlimited, fix zero-value semantics#918
Conversation
Change DefaultMaxConnsPerHost from 100 to 0 (unlimited), matching Go's http.Transport default. The previous hardcoded limit of 100 silently capped streaming throughput at ~149 rps with typical LLM response times, creating a hidden bottleneck that was difficult to diagnose (#916). Fix NewPooledTransportWithOptions to treat MaxConnsPerHost=0 as unlimited (pass through to http.Transport) instead of replacing it with the default. Negative values still fall back to the default. MaxIdleConnsPerHost retains <= 0 guard since zero idle conns would disable connection reuse. The max_conns_per_host field in provider.yaml http_transport config was already wired through but previously couldn't set unlimited (0 was silently replaced with 100).
|
This was referenced Apr 8, 2026
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
DefaultMaxConnsPerHostfrom 100 to 0 (unlimited), matching Go'shttp.TransportdefaultNewPooledTransportWithOptionsto treatMaxConnsPerHost=0as unlimited instead of silently replacing with the default of 100DefaultMaxConnsPerHostThe previous hardcoded limit of 100 silently capped streaming throughput at ~149 rps with typical LLM response times (~670ms), creating a hidden bottleneck discovered during benchmark profiling. The
max_conns_per_hostfield inprovider.yamlhttp_transportconfig was already wired through but couldn't set unlimited because 0 was silently replaced.Benchmark impact (bare metal, 14-core Apple Silicon)
Test plan
TestNewPooledTransportWithOptions_ZeroMaxConnsPerHostMeansUnlimitedruntime/providers/...test suite passespkg/...test suite passesCloses #916