Skip to content

conncache: guess maxconnects different - #22759

Closed
icing wants to merge 2 commits into
curl:masterfrom
icing:cpool-maxconnect-auto-min2
Closed

icing wants to merge 2 commits into
curl:masterfrom
icing:cpool-maxconnect-auto-min2

Conversation

@icing

@icing icing commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Take the number of attached transfers instead of the running ones as guidance how many connections the multi should cache.

In addition, when guessing, only evict a connection if it has not been in use for a second or longer.

Take the number of attached transfers instead of the running
ones as guidance how many connections the multi should cache.

In addition, when guessing, only evict a connection if it has
not been in use for a second or longer.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates automatic connection-cache sizing to use attached transfers and delay eviction of recently used connections.

Changes:

  • Sizes the inferred cache at twice the attached-transfer count.
  • Requires guessed-cache eviction candidates to be idle for one second.
  • Passes consistent timestamps through connection-limit checks.
File summaries
File Description
lib/url.c Supplies connection creation time to limit checks.
lib/multiif.h Declares attached-transfer counting API.
lib/multi.c Implements transfer counting and type updates.
lib/conncache.h Extends the limit-check interface.
lib/conncache.c Revises inferred sizing and age-aware eviction.
Review details

Suppressed comments (1)

lib/conncache.c:659

  • The new comment is missing the subject “it” and ends the sentence with a comma.
    /* We are guessing. So, only evict a "seemingly superfluous" connection
     * when has not been used for this long, */
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/multi.c Outdated
Comment thread lib/conncache.c
@icing
icing requested a review from bagder August 31, 2026 08:41
@bagder bagder closed this in 0f48cf3 Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants