Reuse HTTP connection and add chunked single-request batch resolve - #47
Merged
Conversation
Enable keep-alive on the AyonApi httplib client so the TCP/TLS connection is reused across resolves instead of a fresh handshake per request; over a WAN link the handshake dominates per-call latency. Keep-alive can be disabled with AYON_RESOLVER_NO_KEEPALIVE=1 for benchmarking. Add batchResolvePathSerial(): resolve a whole frontier of uris in one POST over that persistent client, split into capped chunks (m_maxSerialBatchSize) so a large frontier never sends an unbounded request or holds a server DB connection for the full set.
antirotor
approved these changes
Jun 8, 2026
antirotor
left a comment
Member
There was a problem hiding this comment.
It makes sense to me, but lets have @tadeas-hejnic final word :)
The AYON server rejects /api/resolve with HTTP 400 when the X-ayon-site-id header is present but empty or names an unregistered site. That breaks resolution on service-account and cloud workstations with no registered site. Add the header only when m_siteId is non-empty.
tadeas-hejnic
approved these changes
Jun 29, 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.
Changelog Description
Over a WAN link the handshake dominates per-call latency. This PR enables:
1/
keep-alive on the AyonApi httplib client so the TCP/TLS connection is reused across resolves instead of a fresh handshake per request.
2/
batchResolvePathSerial(): which resolves a whole frontier of uris in one POST over that persistent client, split into capped chunks (m_maxSerialBatchSize) so a large frontier never sends an unbounded request or holds a server DB connection for the full set.
Additional review information
Keep-alive can be disabled with AYON_RESOLVER_NO_KEEPALIVE=1 for benchmarking.
Testing notes:
Tested from Cape Town, South Africa to Ynput Cloud. On a heavy shot this PR cut serial stage-open resolution from about 33s to 14s on its own, roughly 2.4x, before any other batching or caching.